overcentric
Version:
A lightweight, privacy-focused toolkit for modern SaaS web applications
52 lines (51 loc) • 1.62 kB
TypeScript
import { Context, InitOptions, AutoCaptureConfig, UserInfo } from './types';
export declare const CONFIG: {
basePath: string;
debugMode: boolean;
isDockEnabled: boolean;
dockColor: string;
isRecordingEnabled: boolean;
autoCapture: AutoCaptureConfig;
initDefaults: Omit<Partial<InitOptions>, "context">;
};
export declare const log: {
debug: (message: string) => void;
error: (message: string, info?: any) => void;
warn: (message: string) => void;
};
/**
* Test function to show that the library was imported.
*/
declare function test(): string;
/**
* Initialize the overcentric library.
* @param id The project ID to use.
* @param options Optional configuration options.
* @returns Promise<void>
*/
declare function init(id: string, options: InitOptions): Promise<void>;
/**
* Identify a user.
* @param id The user ID to identify.
* @param info Optional user information to attach to the identify event.
* @returns void
*/
declare function identify(id: string, info?: UserInfo): void;
/**
* Track an event.
* @param eventName The name of the event.
* @param properties Optional properties to attach to the event.
* @returns void
*/
declare function trackEvent(eventName: string, properties?: Record<string, any>, cb?: any): void;
declare function setContext(ctx: Context): void;
declare function isInitialized(): boolean;
declare const _default: {
test: typeof test;
init: typeof init;
identify: typeof identify;
trackEvent: typeof trackEvent;
setContext: typeof setContext;
isInitialized: typeof isInitialized;
};
export default _default;