Skip to content

armgit / umami

Public Imported from GitHub
0

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.

653 B
Raw Blame
import { useApi } from '../useApi';
import { useDateParameters } from '../useDateParameters';
import { usePagedQuery } from '../usePagedQuery';

export function useSessionReplaysQuery(websiteId: string, sessionId: string) {
  const { get } = useApi();
  const { startAt, endAt, unit, timezone } = useDateParameters();

  return usePagedQuery({
    queryKey: ['session-replays', { websiteId, sessionId, startAt, endAt, unit, timezone }],
    queryFn: pageParams => {
      return get(`/websites/${websiteId}/sessions/${sessionId}/replays`, {
        startAt,
        endAt,
        unit,
        timezone,
        ...pageParams,
      });
    },
  });
}