내용으로 바로가기

시작하기

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 { nativePlugin } from '@capgo/capacitor-rudderstack';

API 개요

API 개요

initialize

초기화

RudderStack 클라이언트를 초기화합니다.

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

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

identify

identify

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

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

group

그룹

그룹 ID를 제공하여 그룹 호출을 보냅니다.

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

제공된 이벤트 이름에 대한 트랙 호출을 보냅니다.

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

제공된 스크린 이름에 대한 스크린 호출을 보냅니다.

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

현재 사용자를 새로운 식별자로 에이リア스합니다.

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

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

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

flush

flush

즉시 큐에 있는 이벤트를 플러시합니다.

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

putDeviceToken

putDeviceToken

푸시 토큰을 설정하여 RudderStack이 지원하는 목적지로 전달합니다.

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('device-token-123');

setAdvertisingId

putAdvertisingId

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

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('advertising-id-123');

putAdvertisingId

setAdvertisingId

사용자 지정 광고 ID 값을 설정합니다.

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

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

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

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

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

루더 스택 추적 옵트아웃을 켜거나 끕니다.

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

타입 참조

Type Reference

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

RudderTraits로 수락하는 특성 데이터입니다. identify 및 group.

export type RudderTraits = Record<string, any>;

RudderProperties

RudderProperties

속성 payload track 및 screen.

export type RudderProperties = Record<string, any>;

PluginVersionResult

버전

로깅

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

RudderLogLevelValue

실질

이 페이지는 플러그인의

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

실제 데이터의 근원

RudderStack 로깅 수준 값

버전 src/definitions.ts. 업스트림에서 pubic API이 변경되었을 때 다시 싱크를 실행하세요.

Getting Started에서 계속

Getting Started에서 계속하는 방법

만약에 Getting Started Getting Started을 통해 대시보드와 API 운영을 계획하고 싶다면 @capgo/capacitor-rudderstack Using @capgo/capacitor-rudderstack를 사용하는 native capability API 개요 API Overview __CAPGO_KEEP_0__ Introduction API 키 implementation 세부 정보를 위한 API 키 기기 implementation 세부 정보를 위한 기기