SurfSense/surfsense_web/components/providers/PostHogProvider.tsx

22 lines
577 B
TypeScript
Raw Normal View History

2025-12-25 13:53:41 -08:00
"use client";
import { PostHogProvider as PHProvider } from "@posthog/react";
import posthog from "posthog-js";
import type { ReactNode } from "react";
import { PostHogIdentify } from "./PostHogIdentify";
2025-12-25 13:53:41 -08:00
interface PostHogProviderProps {
children: ReactNode;
}
export function PostHogProvider({ children }: PostHogProviderProps) {
// posthog-js is already initialized in instrumentation-client.ts
// We just need to wrap the app with the PostHogProvider for hook access
return (
<PHProvider client={posthog}>
<PostHogIdentify />
{children}
</PHProvider>
);
2025-12-25 13:53:41 -08:00
}