mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-06 08:16:03 +00:00
25 lines
764 B
TypeScript
25 lines
764 B
TypeScript
// app/providers.tsx
|
|
"use client";
|
|
import { PendingJobProvider } from "@/contexts/PendingJobContext";
|
|
import posthog from "posthog-js";
|
|
import { PostHogProvider } from "posthog-js/react";
|
|
|
|
if (typeof window !== "undefined") {
|
|
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
|
|
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
person_profiles: "identified_only",
|
|
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
|
|
});
|
|
}
|
|
|
|
export function PHProvider({ children }: { children: React.ReactNode }) {
|
|
return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
|
|
}
|
|
|
|
export function PendingJobsProvider({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return <PendingJobProvider>{children}</PendingJobProvider>;
|
|
}
|