UNPKG

@cruxstack/browser-sdk

Version:

A lightweight, privacy-focused JavaScript SDK for web analytics and event tracking. Built with TypeScript, featuring automatic event capture, event-time environment snapshots, intelligent queuing, and robust error handling.

28 lines (27 loc) 1.03 kB
import { CruxstackConfig, Event } from "../common/types"; import { AutocaptureTrackers, ClickEventData, FormEventData, PageViewEventData } from "../features/autocapture"; export declare function init(config: CruxstackConfig): void; export declare function trackEvent(eventData: { type: string; data?: Record<string, any>; }): void; export declare function getUserTraits(customerId: string): Promise<any>; export declare function getSessionInfo(): { sessionId: null; userId: null; isInitialized: boolean; } | { sessionId: string; userId: string | undefined; isInitialized: boolean; }; export declare function flushEvents(): Promise<void>; export declare function getQueueStatus(): { length: number; events: Event[]; }; export declare function clearQueue(): void; export declare function resetSession(): void; export declare function isInitialized(): boolean; export declare function cleanup(): void; export type { ClickEventData, FormEventData, PageViewEventData, AutocaptureTrackers };