track.ts12 lines · main
1import { useCallback } from "react";
2export function track(event: string, props?: Record<string, unknown>) {
3 if (typeof window !== "undefined") {
4 // Placeholder: send to briven analytics
5 console.debug("[track]", event, props);
6 }
7}
8export function useTrack() {
9 return useCallback((event: string, props?: Record<string, unknown>) => {
10 track(event, props);
11 }, []);
12}