コンテンツにスキップ

はじめに

ターミナル ウィンドウ
bun add @capgo/capacitor-rudderstack
bunx cap sync
import { nativePlugin } from '@capgo/capacitor-rudderstack';

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

メソッドはCordovaの署名を保持するため、2番目の引数はconfigオブジェクトかRudderオプションオブジェクトのいずれかになります。

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

指定されたユーザーIDのためにidentifyコールを送信します。

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

指定されたグループIDに対してグループコールを送信します。

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

指定されたイベント名に対してトラッキングコールを送信します。

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

指定されたスクリーン名に対してスクリーンコールを送信します。

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

現在のユーザーを新しい識別子にエイリアスします。

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

現在のルーダースタック 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');

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

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

カスタム匿名IDの値を設定します。

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

RudderStack トラッキングのオプトアウトを切り替えます。

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

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

RudderConfiguration

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

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_2__

__CAPGO_KEEP_5__

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

__CAPGO_KEEP_7__

__CAPGO_KEEP_8__ identify __CAPGO_KEEP_9__ group.

export type RudderTraits = Record<string, any>;

受け入れられるプロパティのペイロード trackscreen.

export type RudderProperties = Record<string, any>;

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

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

RudderStackのログレベル値がmigrationのために公開されています。

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

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