UNPKG

@carpetai/rrweb-recorder

Version:

A React component for recording user sessions using rrweb. Meant to be used with CarpetAI's Analytics Agent.

41 lines (36 loc) 1.37 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; interface SessionEvent { type: number; timestamp: number; data: Record<string, unknown>; delay?: number; } interface SessionData { sessionId: string; events: SessionEvent[]; timestamp: number; url?: string; } interface SessionRecorderProps { autoStart?: boolean; apiKey: string; apiUrl?: string; maxSessionDuration?: number; saveInterval?: number; excludePaths?: string[]; recordCanvas?: boolean; recordCrossOriginIframes?: boolean; sessionId?: string; onSessionStart?: (sessionId: string) => void; onSessionStop?: (sessionId: string) => void; onError?: (error: Error) => void; } interface SessionRecorderHookReturn { isRecording: boolean; sessionId: string | null; startRecording: () => void; stopRecording: () => void; } declare function SessionRecorder(props: SessionRecorderProps): react_jsx_runtime.JSX.Element; declare function useSessionRecorder({ autoStart, apiKey, apiUrl, maxSessionDuration, saveInterval, excludePaths, recordCanvas, recordCrossOriginIframes, sessionId: customSessionId, onSessionStart, onSessionStop, onError }: SessionRecorderProps): SessionRecorderHookReturn; export { SessionData, SessionEvent, SessionRecorder, SessionRecorderHookReturn, SessionRecorderProps, useSessionRecorder };