refactor session replays to be per visit. sessions persist too long resulting in low-quality recordings

This commit is contained in:
Francis Cao committed 2026-03-03 22:59:25 -08:00
1 parent b2d45613b5
commit 0e1d6cef6b
26 files changed
+248 -83

No files matched your search

@@ -1,13 +1,13 @@
import { useApi } from '../useApi';
export function useReplayQuery(websiteId: string, sessionId: string) {
export function useReplayQuery(websiteId: string, replayId: string) {
const { get, useQuery } = useApi();
return useQuery({
queryKey: ['replay', { websiteId, sessionId }],
queryKey: ['replay', { websiteId, replayId }],
queryFn: () => {
return get(`/websites/${websiteId}/replays/${sessionId}`);
return get(`/websites/${websiteId}/replays/${replayId}`);
},
enabled: Boolean(websiteId && sessionId),
enabled: Boolean(websiteId && replayId),
});
}