Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

368 B
Raw Blame
import { useQuery } from '@tanstack/react-query';
import { useTRPC } from '@/integrations/trpc/react';

export function useCustomEvents(projectId: string) {
  const trpc = useTRPC();
  const query = useQuery(
    trpc.customEvent.list.queryOptions(
      { projectId },
      { enabled: !!projectId, staleTime: 1000 * 60 * 10 }
    )
  );
  return query.data ?? [];
}