내용으로 건너뛰기

시작하기

설치

설치
터미널 창
bun add @capgo/capacitor-rudderstack
bunx cap sync
import { nativePlugin } from '@capgo/capacitor-rudderstack';

initialize

초기화

루더 스택 클라이언트를 초기화합니다.

이 메소드는 Cordova 서명이 유지되므로 두 번째 인자는 config 객체 또는 Rudder 옵션 객체 둘 중 하나여야 합니다.

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

사용자 ID를 제공하여 identify 호출을 보냅니다.

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 식별자 상태를 리셋합니다.

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');

putAdvertisingId

광고 ID 설정

광고 ID를 사용자 정의 값으로 설정합니다.

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

setAnonymousId

익명 ID 설정

현재 계약의 소스 정의를 참조하세요.

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

putAnonymousId

익명 ID 설정

사용자 정의 익명 ID 값을 설정합니다.

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

클립보드에 복사

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

RudderConfiguration

루더 구성 섹션

루더 스택 내장 네이티브 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[];
}

루더 스택 호출당 옵션

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

루더 스택에 의해 수락되는 특성 identifygroup.

export type RudderTraits = Record<string, any>;

RudderProperties가 수락하는 속성 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.ts. 업스트림의 API가 변경되었을 때 다시 싱크를 실행하세요.