Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
import { useApi } from '../useApi';
interface ReplayQueryOptions {
until?: number;
chunkIndex?: number;
eventIndex?: number;
}
export function useReplayQuery(
websiteId: string,
replayId: string,
options: ReplayQueryOptions = {},
) {
const { get, useQuery } = useApi();
const { until, chunkIndex, eventIndex } = options;
return useQuery({
queryKey: ['replay', { websiteId, replayId, until, chunkIndex, eventIndex }],
queryFn: () => {
return get(`/websites/${websiteId}/replays/${replayId}`, { until, chunkIndex, eventIndex });
},
enabled: Boolean(websiteId && replayId),
});
}