UNPKG

@chaseleto/sessions-sdk

Version:

Privacy-conscious session recording SDK for self-hosted session tracking

55 lines 1.76 kB
import { setAttributes, setUserId } from './index'; import type { SessionSDKOptions } from './types'; export declare function useSessionRecording(apiKey: string, options?: SessionSDKOptions & { enabled?: boolean; userId?: string; attributes?: Record<string, any>; }): { sessionId: string | null; isActive: boolean; setAttributes: typeof setAttributes; setUserId: typeof setUserId; }; /** * Initialize Session SDK for Next.js (similar to HyperDX) * This can be called outside of React components */ export declare function initSessionRecording(apiKey: string, options?: SessionSDKOptions & { enabled?: boolean; userId?: string; attributes?: Record<string, any>; }): void; /** * Update user ID for the current session */ export declare function updateUserId(userId: string): void; /** * Update attributes for the current session */ export declare function updateAttributes(attributes: Record<string, any>): void; /** * Get current session ID */ export declare function getCurrentSessionId(): string | null; /** * Check if recording is active */ export declare function isRecordingActive(): boolean; /** * Destroy the session recording instance */ export declare function destroySessionRecording(): void; export declare function SessionRecorder(props: { apiKey: string; projectId?: string; userId?: string; attributes?: Record<string, any>; enabled?: boolean; endpoint?: string; captureConsole?: boolean; captureNetwork?: boolean; samplingRate?: number; respectDNT?: boolean; }): null; export declare function withSessionRecording<P extends object>(Component: any, apiKey: string, options?: SessionSDKOptions): (props: P) => any; //# sourceMappingURL=nextjs.d.ts.map