始め方
このプラグインのインストールステップとフルマークダウンガイドまでの全てのステップを含むセットアップの案内をコピーしてください。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-rudderstack`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/rudderstack/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」のセクションCapgoのAIアシストセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。
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セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-rudderstackbunx cap syncインポート
「インポート」import { nativePlugin } from '@capgo/capacitor-rudderstack';API オーバービュー
「API オーバービュー」initialize
「初期化」RudderStack クライアントを初期化します。
メソッドは Cordova の署名を保持するため、2 番目の引数は config オブジェクトか Rudder のオプションオブジェクトのいずれかになります。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('value');identify
「識別」指定されたユーザー ID に関して識別呼び出しを送信します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('value');group
グループセクション指定されたグループIDに対してグループコールを送信します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.group('value');track
トラッキングセクション指定されたイベント名に対してトラッキングコールを送信します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.track('value');screen
スクリーンセクション指定されたスクリーン名に対してスクリーンコールを送信します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('value');alias
エイリアスセクション現在のユーザーを新しい識別子にエイリアスします。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('value');現在のRudderStack ID状態をリセットします。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();即時でキュー内のイベントをフラッシュします。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();putDeviceToken
Section titled “putDeviceToken”RudderStackがサポートする目的地にプッシュトークンを転送します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('value');setAdvertisingId
Section titled “setAdvertisingId”現在の契約のソース定義を参照してください。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('value');putAdvertisingId
Section titled “putAdvertisingId”広告IDのカスタム値を設定します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('value');setAnonymousId
Section titled “setAnonymousId”現在の契約のソース定義を参照してください。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAnonymousId('value');putAnonymousId
Section titled “putAnonymousId”匿名IDのカスタム値を設定します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAnonymousId('value');optOut
Section titled “optOut”RudderStackのトラッキングをオフにします。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.optOut(true);種類の参照
「種類の参照」RudderConfiguration
「ルーダー設定」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[];}RudderOptions
「ルーダーオプション」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>;}RudderTraits
「ルーダートレイト」ルーダートレイトを受け入れる identify そして group.
export type RudderTraits = Record<string, any>;RudderProperties
「RudderProperties」セクション受け入れられるプロパティペイロード track と screen.
export type RudderProperties = Record<string, any>;PluginVersionResult
「PluginVersionResult」セクションプラグインバージョンペイロード
export interface PluginVersionResult { /** * Version identifier returned by the platform implementation. */ version: string;}RudderLogLevelValue
「RudderLogLevelValue」セクションログレベル値
export type RudderLogLevelValue = 0 | 1 | 2 | 3 | 4 | 5;「ソースオブトゥルース」セクション
コピーこのページはプラグインから生成されます。 src/definitions.ts.再度Syncを実行してください。Public APIがアップストリームで変更されたとき。
Getting Startedから続けてください。
セクションのタイトルは「Getting Startedから続けてください。」あなたが使用している場合 Getting Started ダッシュボードとAPIの計画と実行を計画するために使用している場合、APIを接続してください。 Using @capgo/capacitor-rudderstack Using @capgo/capacitor-rudderstackのネイティブ機能のために API Overview API Overviewの実装詳細のために Introduction 実装の詳細については、Introductionを参照してください。 API キー 実装の詳細については、API キー、そして デバイス 実装の詳細については、デバイスを参照してください。