__CAPGO_KEEP_0__ - 实时更新 __CAPGO_KEEP_1__ 应用程序

开始

GitHub

您可以使用我们的 AI 助手设置来安装插件。使用以下命令将 Capgo 技能添加到您的 AI 工具中:

终端窗口
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-rudderstack
bunx cap sync

导入

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

API概述

API概述

initialize

初始化

初始化 RudderStack 客户端。

方法保留 Cordova 签名,因此第二个参数可以是配置对象或 Rudder 选项对象。

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

identify

识别

发送给定用户 ID 的识别调用。

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

将当前用户别名为新标识符。

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

设置自定义广告 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[];
}

RudderOptions

路德选项

复制到剪贴板

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

特征

identify 复制到剪贴板 group.

export type RudderTraits = Record<string, any>;

RudderProperties

RudderProperties

被接受的属性 trackscreen.

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;

RudderProperties

被接受的属性

本页面由插件生成。 src/definitions.ts重新同步时,公共API上游发生变化。

如果您正在使用 Getting Started 来规划仪表板和API操作,连接它到 使用@capgo/capacitor-rudderstack 为native能力在使用@capgo/capacitor-rudderstack中 API概述 为API概述中的实现细节 介绍 为《介绍》中实现细节 API Keys 为《API Keys》中实现细节,并且 设备 为《设备》中实现细节。