@amplitude/session-replay-react-native
Version:
Amplitude Session Replay for React Native
77 lines • 2.9 kB
TypeScript
import { type EnrichmentPlugin, type Event, type ReactNativeClient, type ReactNativeConfig } from '@amplitude/analytics-types';
import { SessionReplayPluginConfig } from './plugin-session-replay-config';
/**
* Session Replay Plugin for React Native Amplitude SDK.
* This plugin automatically handles session replay recording and event correlation.
*
* The plugin automatically handles:
* - Device ID and Session ID management
* - Session ID changes
* - Event property collection and tracking
*/
export declare class SessionReplayPlugin implements EnrichmentPlugin<ReactNativeClient, ReactNativeConfig> {
name: string;
type: "enrichment";
private config;
private isInitialized;
private sessionReplayConfig;
private logger;
/**
* Create a new Session Replay Plugin instance.
*
* @param config - Configuration options for the session replay plugin
*
* @example
* ```typescript
* const sessionReplayPlugin = new SessionReplayPlugin({
* sampleRate: 0.1,
* enableRemoteConfig: true,
* logLevel: LogLevel.Warn,
* autoStart: true
* });
* ```
*/
constructor(config?: SessionReplayPluginConfig);
/**
* Set up the Session Replay Plugin with the Amplitude configuration.
* This method is called automatically by the Amplitude SDK during initialization.
*
* @param config - The React Native configuration from the Amplitude SDK
* @param _ - The React Native client instance (unused)
* @returns Promise that resolves when setup is complete
*/
setup(config: ReactNativeConfig, _: ReactNativeClient): Promise<void>;
execute(event: Event): Promise<Event | null>;
/**
* Start session replay recording.
* Begins capturing user interactions and screen content for replay.
*
* @returns Promise that resolves when recording starts
*/
start(): Promise<void>;
/**
* Stop session replay recording.
* Ends the current recording session and processes any captured data.
*
* @returns Promise that resolves when recording stops
*/
stop(): Promise<void>;
teardown(): Promise<void>;
/**
* Get session replay properties for manual event correlation.
* When you send events to Amplitude, call this method to get the most up-to-date session replay properties for the event.
*
* @returns Promise that resolves to an object containing session replay metadata
*
* @example
* ```typescript
* const sessionReplayProperties = await plugin.getSessionReplayProperties();
* analytics.track('Button Clicked', {
* buttonName: 'submit',
* ...sessionReplayProperties
* });
* ```
*/
getSessionReplayProperties(): Promise<import("./session-replay").SessionReplayProperties>;
}
//# sourceMappingURL=plugin-session-replay.d.ts.map