/** * App City Analytics SDK - Browser Implementation * * This file contains the browser-specific implementation of the App City SDK, * including functionality for client-side tracking and browser-specific * context gathering. */ import { AppCityBase, AppCityOptions, EventContext, EventObject } from '@app-city/analytics-core'; /** * Browser-specific implementation of the App City SDK. */ export declare class AppCityBrowser extends AppCityBase { /** * Network manager for handling API requests */ private networkManager; /** * Store cookie information (if available) */ private cookiesEnabled; /** * Window visibility state */ private isWindowVisible; /** * Time when the page was loaded */ private pageLoadTime; /** * Reference to the visibilitychange event listener */ private visibilityChangeListener; /** * Reference to the beforeunload event listener */ private beforeUnloadListener; /** * Flag to track if DOM features have been set up */ private isDoneSettingUpDomFeatures; /** * Initialize the SDK with an API key and options * Override to handle DOM readiness */ init(apiKey: string, options?: AppCityOptions): void; /** * Setup environment-specific context for browser */ protected setUpEnvironmentContext(): void; /** * Set up DOM-dependent features once the DOM is ready */ private setupDomReadyState; /** * Send events to the API */ protected sendEvents(events: EventObject[]): Promise; /** * Set browser information in the context */ private setBrowserInfo; /** * Set device information in the context */ private setDeviceInfo; /** * Setup tracking for page visibility changes, so we can flush events when the * page becomes visible again. */ private setupVisibilityTracking; /** * Setup event listener to flush events before page unload */ private setupBeforeUnloadFlush; /** * Generate an anonymous ID with browser storage * Override base implementation to use browser storage for persistence */ protected generateAnonymousId(): string; /** * Reset user identification and clean up storage * Override to handle browser-specific cleanup */ reset(): void; /** * Build the context object for an event with browser-specific additions */ protected buildEventContext(): EventContext; /** * Clean up event listeners and resources * Public method to allow proper cleanup when SDK is no longer needed */ cleanup(): void; } declare const analytics: AppCityBrowser; export default analytics; export declare const init: (apiKey: string, options?: AppCityOptions) => void; export declare const track: (event: string, properties?: Record) => void; export declare const identify: (userId: string, traits?: Record) => void; export declare const reset: () => void; export declare const flush: () => Promise; export declare const setContext: (key: string, value: unknown) => void; export declare const cleanup: () => void;