コンテンツにジャンプ

Getting Started

GitHub

インストール

Install

AI-Assisted セットアップを使用してプラグインをインストールすることができます。AIツールに次のコマンドを使用して、Capgoスキルを追加します。

Terminal
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次のプロンプトを使用してください。

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-rudderstack` plugin in my project.

Manual セットアップを使用する場合は、次のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。

Terminal
bun add @capgo/capacitor-rudderstack
bunx cap sync
import { nativePlugin } from '@capgo/capacitor-rudderstack';

API まとめ

API まとめ

セクションのタイトル “initialize”

RudderStack クライアントを初期化します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('value');

identify

コピー

セクションのタイトル “identify”

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('value');

セクションのタイトル “group”

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.group('value');

track

track

イベント名を指定してトラックコールを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.track('value');

screen

screen

画面名を指定してスクリーンコールを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('value');

alias

alias

現在のユーザーを新しい識別子にAliasします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('value');

reset

reset

現在のルーダースタックIDをリセットします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();

即時実行キュー内のイベントをフラッシュします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();

RudderStackがサポートするすべての宛先に送信されるプッシュ トークンを設定します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('value');

現在の契約のソース定義を参照してください。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('value');

カスタム広告 ID 値を設定します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('value');

See the source definitions for the current contract.

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAnonymousId('value');

Sets a custom anonymous id value.

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAnonymousId('value');

Toggles RudderStack tracking opt-out.

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.optOut(true);

RudderStackの下位レベルのネイティブSDKのサポートされる構成キー

export interface RudderConfiguration {
/**
* RudderStack data plane URL.
*/
dataPlaneUrl?: string;
/**
* Number of events to batch before a flush.
*/
flushQueueSize?: number;
/**
* Database row threshold that triggers pruning on Android and iOS.
*/
dbCountThreshold?: number;
/**
* Server config refresh interval in hours.
*/
configRefreshInterval?: number;
/**
* RudderStack log verbosity.
*/
logLevel?: RudderLogLevelValue;
/**
* Sleep timeout / sleep count used by the native SDK.
*/
sleepTimeOut?: number;
/**
* Android only. Lets the native SDK collect the advertising identifier automatically.
*/
autoCollectAdvertId?: boolean;
/**
* Tracks `Application Installed`, `Application Updated`, and `Application Opened` automatically.
*/
trackLifecycleEvents?: boolean;
/**
* RudderStack control plane URL.
*/
controlPlaneUrl?: string;
/**
* Enables automatic screen tracking where supported by the native SDK.
*/
recordScreenViews?: boolean;
/**
* Ignored in this Capacitor port.
*
* The Cordova SDK uses this field to bootstrap native destination factories from companion plugins.
* Those extension packages are not implemented in this first Capacitor release.
*/
factories?: any[];
}

RudderStackの各呼び出しオプション

export interface RudderOptions {
/**
* External identifiers forwarded with the event.
*/
externalIds?: Record<string, string>;
/**
* Destination enablement flags keyed by integration name.
*/
integrations?: Record<string, boolean>;
}

Traits Payloadを受け入れる identifygroup.

export type RudderTraits = Record<string, any>;

Properties Payloadを受け入れる trackscreen.

export type RudderProperties = Record<string, any>;

プラグインバージョンペイロード。

export interface PluginVersionResult {
/**
* Version identifier returned by the platform implementation.
*/
version: string;
}

RudderStackのログレベル値を、移行のための便宜上公開しています。

export type RudderLogLevelValue = 0 | 1 | 2 | 3 | 4 | 5;

このページはプラグインの src/definitions.tsAPIのパブリックがアップストリームで変更されたら、再度Syncを実行してください。

Getting Startedから続けてください

「Getting Started」から続けてください

あなたは「を使用しています Getting Started ダッシュボードとAPIの作業を計画する場合に接続してください native capabilityのために@capgo/capacitor-rudderstackを使用 native capabilityの@capgo/capacitor-rudderstackの使用の詳細 APIの概要 APIの実装の詳細 概要 実装の詳細 APIのキー APIの実装の詳細 デバイス デバイスの実装詳細について