@thrivestack/analytics-browser
Version:
ThriveStack Analytics Platform - Comprehensive web analytics tracking with privacy-first approach
45 lines • 1.75 kB
TypeScript
import { ThriveStack } from './thrivestack';
import { ThriveStackOptions, ThriveStackEvent } from './types';
/**
* Initialize ThriveStack analytics
* @param apiKey - Your ThriveStack API key
* @param source - Optional source identifier
* @param options - Optional configuration options
*/
export declare function init(apiKey: string, source?: string, options?: Omit<ThriveStackOptions, 'apiKey'>): Promise<void>;
/**
* Set user information
* @param email - User's email address
* @param userId - User's unique identifier
* @param properties - Optional user properties
*/
export declare function setUser(email: string, userId: string, properties?: Record<string, any>): Promise<any | null>;
/**
* Set group information
* @param groupId - Group's unique identifier
* @param groupDomain - Group's domain
* @param groupName - Group's name
* @param properties - Optional group properties
*/
export declare function setGroup(groupId: string, groupDomain: string, groupName: string, properties?: Record<string, any>): Promise<any | null>;
/**
* Track custom events
* @param eventName - Name of the event
* @param properties - Optional event properties
*/
export declare function track(eventName: string, properties?: Record<string, any>): Promise<any>;
/**
* Track multiple events using array type (ThriveStackEvent[])
* @param events - Array of ThriveStackEvent objects
*/
export declare function trackEvents(events: ThriveStackEvent[]): Promise<any>;
/**
* Get the ThriveStack instance (for advanced usage)
*/
export declare function getInstance(): ThriveStack | null;
/**
* Check if ThriveStack is initialized
*/
export declare function isInitialized(): boolean;
export * from './types';
//# sourceMappingURL=index.d.ts.map