import type { LogLevel, SDKConfig, SDKStatus } from './types/events'; export type { SessionRecorder as Recorder, SessionRecorder } from './recorder/session'; export type { CapturedEvent, LogLevel, SDKConfig, SDKError, SDKErrorCode, SDKStatus, } from './types/events'; /** * Initialize the SupaStory SDK * * Call this function once when your application starts to begin capturing * user sessions. The SDK will automatically capture DOM mutations, clicks, * scrolls, network requests, and other user interactions. * * @param config - SDK configuration options * @returns void * * @example * // Basic initialization * SupaStory.init({ * projectKey: 'pk_live_abc123', * }); * * @example * // With callbacks and custom options * SupaStory.init({ * projectKey: 'pk_live_abc123', * sampleRate: 0.1, // Capture 10% of sessions * logLevel: 'info', * onReady: (sessionId) => { * console.log('Recording started:', sessionId); * }, * onError: (error) => { * myErrorTracker.capture(error); * }, * }); * * @throws Never throws - errors are passed to onError callback or logged */ export declare function init(config: SDKConfig): void; /** * Manually start recording * * Use this when autoStart is false to begin recording after user consent * or other initialization logic. This allows you to control exactly when * recording begins. * * @example * // Initialize without auto-starting * SupaStory.init({ * projectKey: 'pk_live_abc123', * autoStart: false, * }); * * // Later, after user consent * if (userGaveConsent) { * SupaStory.start(); * } */ export declare function start(): void; /** * Stop recording and clean up the SDK * * Call this when you want to completely stop capturing. The SDK will * flush any remaining events and clean up all observers. * * @example * // Stop recording when user logs out * function handleLogout() { * SupaStory.stop(); * } */ export declare function stop(): void; /** * Pause recording temporarily * * Use this to temporarily stop capturing without ending the session. * Events during the pause will not be captured. Call resume() to continue. * * @example * // Pause during sensitive operations * SupaStory.pause(); * await showSensitiveModal(); * SupaStory.resume(); */ export declare function pause(): void; /** * Resume recording after pause * * Continues capturing after a pause(). A new snapshot will be taken * to capture any DOM changes that occurred while paused. * * @example * SupaStory.resume(); */ export declare function resume(): void; /** * Get the current session ID * * Returns the unique identifier for the current recording session. * Useful for linking sessions to your own analytics or support tools. * * @returns The session ID, or null if not recording * * @example * const sessionId = SupaStory.getSessionId(); * if (sessionId) { * // Link to support ticket * supportTicket.sessionReplayUrl = `https://app.supastory.com/replay/${sessionId}`; * } */ export declare function getSessionId(): string | null; /** * Check if currently recording * * @returns true if actively recording, false if stopped or paused * * @example * if (SupaStory.isRecording()) { * console.log('Session replay is active'); * } */ export declare function isRecording(): boolean; /** * Get the current SDK status * * Returns detailed information about the SDK state, useful for * debugging and monitoring. * * @returns Current SDK status * * @example * const status = SupaStory.getStatus(); * console.log('Events captured:', status.eventCount); * console.log('Queue size:', status.queueSize); * * if (status.sampledOut) { * console.log('This session was not sampled'); * } */ export declare function getStatus(): SDKStatus; /** * Identify the current user * * Links the current session to a user in your system. Call this * after your user logs in to associate their sessions. * * @param userId - Your internal user identifier * @param traits - Optional additional user properties * * @example * // After user login * SupaStory.identify('user_123', { * email: 'user@example.com', * plan: 'premium', * }); */ export declare function identify(userId: string, traits?: Record): void; /** * Set the log level for SDK debugging output * * @param level - The log level to set * * @example * // Enable verbose logging for debugging * SupaStory.setLogLevel('verbose'); * * // Disable all logging * SupaStory.setLogLevel('none'); */ export declare function setLogLevel(level: LogLevel): void; declare const _default: { init: typeof init; start: typeof start; stop: typeof stop; pause: typeof pause; resume: typeof resume; getSessionId: typeof getSessionId; isRecording: typeof isRecording; getStatus: typeof getStatus; identify: typeof identify; setLogLevel: typeof setLogLevel; }; export default _default;