mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
- 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.
22 lines
551 B
TypeScript
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>
|
|
);
|
|
}
|