@easyflow/pixel
Version:
Easyflow client-side pixel SDK
27 lines (26 loc) • 936 B
TypeScript
import { PixelEvent } from './pixel-event.enum';
import { AtLeastOne, EventsBufferRecord, TrackBy } from './@types/types';
export declare class EasyflowPixel {
private readonly ownerId;
private readonly fingerprintId;
private readonly urlBase;
private readonly minBufferSize;
private readonly minFlushIntervalMs;
private lastFlushTimestamp;
private isFlushing;
private STORE_KEY;
private pixelMap;
private eventsBuffer;
private readonly trackBy;
private readonly debouncedFlush;
constructor(ownerId: string, fingerprintId: string, trackBy: AtLeastOne<TrackBy>);
init(): Promise<void>;
private loadLifeCycleEvents;
private getPlatformSender;
track(event: PixelEvent, payload?: Record<string, any>): void;
private mapToApiRecord;
storeChunkEvents(events: EventsBufferRecord[]): void;
replayFallbackEvents(): void;
private flush;
}
export { PixelEvent };