@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.36 kB
TypeScript
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;
onSessionStart?: (sessionId: string) => void;
onSessionStop?: (sessionId: string) => void;
onError?: (error: Error) => void;
maskAllInputs?: boolean;
}
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, onSessionStart, onSessionStop, onError, maskAllInputs, }: SessionRecorderProps): SessionRecorderHookReturn;
export { SessionData, SessionEvent, SessionRecorder, SessionRecorderHookReturn, SessionRecorderProps, useSessionRecorder };