시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
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 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.수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-rudderstackbunx cap sync가져오기
“Import” 섹션import { nativePlugin } from '@capgo/capacitor-rudderstack';빠른 시작
“빠른 시작” 섹션import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize({ writeKey: 'YOUR_WRITE_KEY', dataPlaneUrl: 'https://your.dataplane.rudderstack.com',});await nativePlugin.identify({ userId: 'user_123', traits: { plan: 'pro' } });await nativePlugin.track({ event: 'Signed Up', properties: { source: 'mobile' } });예시: 화면 추적
“예시: 화면 추적”이라는 제목의 섹션await nativePlugin.screen({ screen: 'Checkout', properties: { step: 'payment' },});자주 하는 실수
“흔한 실수” 섹션- 한 번만 초기화: 반복됨
initialize()호출 시 SDK 상태가 중복될 수 있으므로, 앱 부트스트랩 단계에서 제어하세요. - 백그라운드 전환 전 Flush 실행: 호출
flush()iOS 또는 Android가 업로드 도중 프로세스를 일시 중단할 수 있습니다. - 광고 ID: 개인정보 처리방침에 IDFA 또는 GAID 수집 내용이 포함된 경우에만 opt in 도우미를 사용하세요.
API 개요
“API 개요” 섹션initialize
“initialize” 섹션RudderStack 클라이언트를 초기화합니다.
이 메서드는 Cordova 시그니처를 유지하므로, 두 번째 인자로 config 객체 또는 Rudder options 객체를 모두 사용할 수 있습니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('write-key-123');identify
“identify” 섹션제공된 user id로 identify 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('user-id-123');group
“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
“screen” 섹션제공된 화면 이름으로 screen 호출을 보냅니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('screen');alias
“alias” 섹션현재 사용자를 새 식별자로 alias합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('new-id-123');reset
“reset” 섹션현재 RudderStack identity 상태를 재설정합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();flush
“flush” 섹션대기 중인 이벤트를 즉시 flush합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();putDeviceToken
“putDeviceToken” 섹션RudderStack이 지원되는 destination으로 전달할 push token을 설정합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('device-token-123');setAdvertisingId
“setAdvertisingId” 섹션현재 contract의 소스 정의를 확인하세요.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('advertising-id-123');putAdvertisingId
“putAdvertisingId” 섹션사용자 정의 광고 ID 값을 설정합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('advertising-id-123');setAnonymousId
“setAnonymousId” 섹션현재 contract의 소스 정의를 확인하세요.
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” 섹션RudderStack 트래킹 옵트아웃을 토글합니다.
import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.optOut(true);타입 레퍼런스
“타입 참조” 섹션RudderConfiguration
“RudderConfiguration” 섹션기반이 되는 RudderStack native 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 페이로드: identify 및 group.
export type RudderTraits = Record<string, any>;RudderProperties
“RudderProperties” 섹션다음에서 수락되는 Properties 페이로드: 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;Source of Truth
“Source Of Truth” 섹션이 페이지는 플러그인의 src/definitions.tsupstream에서 public API가 변경되면 sync를 다시 실행하세요.
시작하기 다음 단계
“Getting Started에서 계속하기” 섹션사용 중이라면 시작하기 대시보드 및 API 운영을 계획하려면, 이를 다음과 연결하세요 @capgo/capacitor-rudderstack 사용하기 @capgo/capacitor-rudderstack를 사용하여 네이티브 기능을 구현할 때, API 개요 구현 세부 사항은 API 개요에서 소개 구현 세부 사항은 소개에서 API 키 API Keys의 구현 세부 사항은, 기기 Devices의 구현 세부 사항은.