mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
22 lines
482 B
TypeScript
22 lines
482 B
TypeScript
"use client";
|
|
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
|
|
import { useJune } from "./useJune";
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useEventTracking = () => {
|
|
const analytics = useJune();
|
|
const { session } = useSupabase();
|
|
|
|
const track = async (event: string): Promise<void> => {
|
|
await analytics?.identify(session?.user.id);
|
|
await analytics?.track(event);
|
|
};
|
|
|
|
return {
|
|
track,
|
|
};
|
|
};
|