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";
|
2026-01-27 13:23:45 -05:00
|
|
|
import "../../instrumentation-client";
|
2026-01-02 01:10:16 -08:00
|
|
|
import { PostHogIdentify } from "./PostHogIdentify";
|
2025-12-25 13:53:41 -08:00
|
|
|
|
|
|
|
|
interface PostHogProviderProps {
|
|
|
|
|
children: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function PostHogProvider({ children }: PostHogProviderProps) {
|
2026-01-27 13:23:45 -05:00
|
|
|
// posthog-js is initialized by importing instrumentation-client.ts above
|
|
|
|
|
// We wrap the app with the PostHogProvider for hook access
|
2026-01-02 01:10:16 -08:00
|
|
|
return (
|
|
|
|
|
<PHProvider client={posthog}>
|
|
|
|
|
<PostHogIdentify />
|
|
|
|
|
{children}
|
|
|
|
|
</PHProvider>
|
|
|
|
|
);
|
2025-12-25 13:53:41 -08:00
|
|
|
}
|