@brainfish-ai/web-tracker
Version:
Brainfish Tracker for Web
39 lines (38 loc) • 1.43 kB
TypeScript
import { TrackerSdkOptions, TrackProperties, TrackerSdk } from '@brainfish-ai/tracker-sdk';
export type * from '@brainfish-ai/tracker-sdk';
export type TrackerOptions = TrackerSdkOptions & {
trackOutgoingLinks?: boolean;
trackScreenViews?: boolean;
trackAttributes?: boolean;
trackHashChanges?: boolean;
enableRecording?: boolean;
recordingBlocklist?: string[];
_allowLocalhostRecording?: boolean;
_allowScreenRecording?: boolean;
};
export declare const VERSION: string;
export declare class Tracker extends TrackerSdk {
options: TrackerOptions;
private lastPath;
private debounceTimer;
private readonly agent;
private readonly sessionManager;
private readonly recordingBlocklist;
private readonly MAX_SCREENSHOT_SIZE;
constructor(options: TrackerOptions);
private debounce;
private isServer;
trackOutgoingLinks(): void;
trackScreenViews(): void;
trackAttributes(): void;
startRecording(): void;
screenView(properties?: TrackProperties): Promise<void>;
screenView(path: string, properties?: TrackProperties): Promise<void>;
/**
* Handles recording events to the server and manages session state transitions.
* @param events Array of events to be recorded
* @returns Promise that resolves when events are recorded and session is managed
*/
private recordEventsToServer;
private sendScreenViewEvent;
}