はじめから始めよう
インストール手順とこのプラグインの全マークダウンガイドを含むセットアップ用の質問をコピー
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 Setup を好む場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム固有の説明を参照してください。
bun add @capgo/capacitor-rudderstackbunx cap syncインポート
「インポート」のセクションimport { nativePlugin } from '@capgo/capacitor-rudderstack';API オーバービュー
「API オーバービュー」のセクションinitialize
「initialize」のセクションRudderStack クライアントを初期化します。
メソッドは Cordova の署名を保持しているため、2 番目の引数は config オブジェクトか Rudder のオプションオブジェクトのいずれかになります。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('value');identify
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('value');group
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.group('value');track
__CAPGO_KEEP_1____CAPGO_KEEP_4__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.track('value');screen
__CAPGO_KEEP_1____CAPGO_KEEP_5__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('value');alias
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('value');reset
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();flush
__CAPGO_KEEP_1____CAPGO_KEEP_4__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();putDeviceToken
__CAPGO_KEEP_1____CAPGO_KEEP_5__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('value');setAdvertisingId
セクション「setAdvertisingId」現在の契約のソース定義を参照してください。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('value');putAdvertisingId
セクション「putAdvertisingId」カスタム広告IDの値を設定します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('value');setAnonymousId
セクション「setAnonymousId」現在の契約のソース定義を参照してください。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAnonymousId('value');putAnonymousId
セクション「putAnonymousId」カスタム匿名IDの値を設定します。
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAnonymousId('value');optOut
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.optOut(true);__CAPGO_KEEP_3__
__CAPGO_KEEP_4__RudderConfiguration
__CAPGO_KEEP_5____CAPGO_KEEP_6__
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
__CAPGO_KEEP_7____CAPGO_KEEP_8__
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
RudderTraitsのセクションRudderTraitsの特性を受け入れる identify と group.
export type RudderTraits = Record<string, any>;RudderProperties
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のセクション移行の便宜のために公開されているRudderStackログレベル値。
export type RudderLogLevelValue = 0 | 1 | 2 | 3 | 4 | 5;真実の源
「真実の源」というセクションこのページはプラグインから生成されています。 src/definitions.tsパブリックのAPIがアップストリームで変更された場合に再度syncを実行してください。
「Getting Started」から続けてください。
「Getting Started」から続けてください」というセクションあなたが「を使用している場合 「Getting Started」 ダッシュボードとAPIの計画と操作を行う場合に接続してください。 @capgo/capacitor-rudderstackを使用 native capabilityの使用に@capgo/capacitor-rudderstackを使用します。 APIの概要 APIの実装詳細 導入 __CAPGO_KEEP_0__の実装詳細 APIのキー APIの実装詳細 デバイス __CAPGO_KEEP_0__の実装詳細