시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
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.
설치
설치AI-assisted 설정을 사용하여 플러그인을 설치할 수 있습니다. 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 syncImport
Import 섹션import { nativePlugin } from '@capgo/capacitor-rudderstack';API 개요
API 개요 섹션initialize
initializeRudderStack 클라이언트를 초기화합니다.
Cordova 서명이 유지되므로 두 번째 인자는 config 객체 또는 Rudder 옵션 객체 둘 중 하나여야 합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('write-key-123');identify
identify제공된 사용자 ID에 대한 identify 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('user-id-123');group
group제공된 그룹 ID에 대한 group 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.group('group-id-123');track
track제공된 이벤트 이름에 대한 track 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.track('event');screen
스크린 제목제공된 스크린 이름에 대한 스크린 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('screen');alias
별칭 제목현재 사용자를 새로운 식별자로 별칭합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('new-id-123');reset
리셋 제목현재 루더 스택 식별자 상태를 리셋합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();flush
플러시 제목임의로 큐드 이벤트를 즉시 플러시합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();putDeviceToken
장치 토큰을 설정하는 섹션RudderStack이 지원하는 모든 목적지로 장치 토큰을 전달합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('device-token-123');setAdvertisingId
광고 ID를 설정하는 섹션현재 계약의 소스 정의를 참조하세요.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('advertising-id-123');putAdvertisingId
광고 ID를 설정하는 섹션광고 ID의 사용자 지정 값을 설정합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('advertising-id-123');setAnonymousId
익명 ID를 설정하는 섹션현재 계약의 소스 정의를 참조하세요.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAnonymousId('anonymous-id-123');putAnonymousId
“putAnonymousId” 섹션사용자 고유 ID 값을 설정합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAnonymousId('anonymous-id-123');optOut
“optOut” 섹션루더 스택 추적 옵트 아웃을 켜거나 끕니다.
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[];}RudderOptions
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
RudderTraits 섹션Traits payload로 identify 그리고 group.
export type RudderTraits = Record<string, any>;RudderProperties
RudderProperties 섹션Properties payload로 track 그리고 screen.
export type RudderProperties = Record<string, any>;PluginVersionResult
PluginVersionResult 섹션플러그인 버전 데이터.
export interface PluginVersionResult { /** * Version identifier returned by the platform implementation. */ version: string;}RudderLogLevelValue
RudderLogLevelValueRudderStack 로그 레벨 값이 제공되며, 이전 버전의 데이터를 이전하는 데 도움이 됩니다.
export type RudderLogLevelValue = 0 | 1 | 2 | 3 | 4 | 5;실질적인 데이터
실질적인 데이터이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting Started에서 계속이미 플러그인을 사용 중이라면 시작하기 계획 대시보드 및 API 작업을 계획하고 연결하세요. @capgo/capacitor-rudderstack을 사용하여 native 기능을 사용하는 @capgo/capacitor-rudderstack을 사용하여 API 개요 API 개요의 구현 세부 정보를 참조하세요. 소개 소개의 구현 세부 정보를 참조하세요. API 키 API 키의 구현 세부 정보를 참조하세요. 장치 __CAPGO_KEEP_0__의 구현 세부 정보를 참조하세요.