내용으로 건너뛰기

시작하기

GitHub

플러그인을 설치하기 위해 AI-Assisted Setup을 사용할 수 있습니다. 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-rudderstack
bunx cap sync

Import

Import
import { nativePlugin } from '@capgo/capacitor-rudderstack';

API Overview

API Overview

initialize

The method keeps the Cordova signature, so the second argument may be either a config object or a Rudder options object.

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

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

현재 사용자를 새로운 식별자로.alias합니다.

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

현재 RudderStack identity 상태를 초기화합니다.

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

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>;
}

루더 스택에 의해 수락되는 트레이트 페이로드입니다. identify 그리고 group.

export type RudderTraits = Record<string, any>;

RudderProperties

RudderProperties 섹션

RudderProperties trackscreen.

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;

Source Of Truth 섹션

Source Of Truth

이 페이지는 플러그인의 src/definitions.ts. 업스트림에서 API이 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속하기

Getting Started에서 계속하기

Getting Started Getting Started 계획 대시보드 및 API 운영을 위해 Getting Started을 사용하는 경우 Using @capgo/capacitor-rudderstack Using @capgo/capacitor-rudderstack Using @API/__CAPGO_KEEP_1__-rudderstack API Overview __CAPGO_KEEP_0__ Overview implementation 설명을 위한 Introduction API 키 implementation 설명을 위한 API 키, 그리고 기기 implementation 설명을 위한 기기.