Saltare al contenuto

Inizia

Finestra del terminale
bun add @capgo/capacitor-rudderstack
bunx cap sync
import { nativePlugin } from '@capgo/capacitor-rudderstack';

Inizializza il client RudderStack.

Il metodo mantiene la firma Cordova, quindi l'argomento secondario può essere sia un oggetto di configurazione che un oggetto Rudder.

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

Invia un chiamata di identificazione per l'ID utente fornito.

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

Invia una chiamata di gruppo per l'ID del gruppo fornito.

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

Invia una chiamata di tracciamento per il nome dell'evento fornito.

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

Invia una chiamata di schermo per il nome dello schermo fornito.

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

Alias il corrente utente a un nuovo identificatore.

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

Rimette allo stato di base l'identità corrente di RudderStack.

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

Pulisce gli eventi in coda immediatamente.

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

Imposta il token di push che RudderStack invia ai destinatari supportati.

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

Vedi le definizioni di riferimento per il contratto corrente.

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

Imposta un valore personalizzato per l'ID dell'annuncio.

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

Vedi le definizioni di riferimento per il contratto corrente.

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

Imposta un valore personalizzato per l'ID anonimo.

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

Abilita o disabilita l'invio di tracce di RudderStack.

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

Chiavi di configurazione supportate per gli SDK nativi di RudderStack.

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

Opzioni di RudderStack per chiamata.

export interface RudderOptions {
/**
* External identifiers forwarded with the event.
*/
externalIds?: Record<string, string>;
/**
* Destination enablement flags keyed by integration name.
*/
integrations?: Record<string, boolean>;
}

Payload accettati da identify e group.

export type RudderTraits = Record<string, any>;

Payload di proprietà accettate da track e screen.

export type RudderProperties = Record<string, any>;

Payload di versione del plugin.

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

Valori di livello di registro RudderStack esposti per comodità di migrazione.

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

Questa pagina è generata dal plugin src/definitions.tsRiepiloga quando le modifiche pubbliche API sono state apportate in fase di sincronizzazione.