SurfSense/surfsense_web/components/providers/PostHogProvider.tsx
DESKTOP-RTLN3BA\$punk 5e28125090 feat: Enhance PostHog integration with referral tracking and error handling
- Added referral code tracking in PostHog initialization to capture initial and last seen referral codes.
- Wrapped PostHog capture calls in a safeCapture function to prevent app breakage due to ad-blockers.
- Introduced PostHogReferral component in PostHogProvider for improved referral tracking.
2026-03-11 02:47:46 -07:00

22 lines
551 B
TypeScript

"use client";
import { PostHogProvider as PHProvider } from "@posthog/react";
import posthog from "posthog-js";
import type { ReactNode } from "react";
import "../../instrumentation-client";
import { PostHogIdentify } from "./PostHogIdentify";
import { PostHogReferral } from "./PostHogReferral";
interface PostHogProviderProps {
children: ReactNode;
}
export function PostHogProvider({ children }: PostHogProviderProps) {
return (
<PHProvider client={posthog}>
<PostHogIdentify />
<PostHogReferral />
{children}
</PHProvider>
);
}