kromemo
Version:
Browser event capture SDK for Kromemo: batching, retries, dedupe, TypeScript-first.
52 lines • 1.32 kB
TypeScript
export type IngestEventType = 'event' | 'view' | 'error';
export interface IngestEvent {
name: string;
type?: IngestEventType;
ts?: number | string;
timestamp?: number | string;
device_id?: string;
url?: string;
referrer?: string;
country?: string;
os?: string;
payload?: Record<string, any>;
}
export interface SenderResponseBody {
ok: boolean;
eventCount: number;
registeredCount: number;
}
export interface KromemoInitOptions {
projectId: string;
apiKey: string;
endpointBase?: string;
maxBatchSize?: number;
maxQueueBytes?: number;
flushIntervalMs?: number;
retryMaxAttempts?: number;
dedupeWindowMs?: number;
}
export interface QueueOptions {
projectId: string;
apiKey: string;
endpointBase?: string;
maxBatchSize: number;
maxQueueBytes: number;
flushIntervalMs: number;
retryMaxAttempts: number;
}
export interface TrackEventInput {
name: string;
payload?: Record<string, any>;
ts?: number | string;
}
export interface TrackViewInput {
name?: string;
url?: string;
payload?: Record<string, any>;
}
export interface TrackErrorInput {
error: Error | string;
payload?: Record<string, any>;
}
//# sourceMappingURL=types.d.ts.map