UNPKG

overcentric

Version:

A lightweight, privacy-focused toolkit for modern SaaS web applications

64 lines (63 loc) 1.98 kB
import { Context, InitOptions, AutoCaptureConfig, UserInfo } from './types'; export declare const CONFIG: { basePath: string; debugMode: boolean; isDockEnabled: boolean; isRecordingEnabled: boolean; isKBEnabled: boolean; isChatEnabled: 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; /** * Dock interactions */ declare function openDock(): void; declare function closeDock(): void; declare function openChat(): void; declare function openHCArticle(articleId: string): void; declare const _default: { test: typeof test; init: typeof init; identify: typeof identify; trackEvent: typeof trackEvent; setContext: typeof setContext; isInitialized: typeof isInitialized; openDock: typeof openDock; closeDock: typeof closeDock; openChat: typeof openChat; openHCArticle: typeof openHCArticle; }; export default _default;