diff --git a/src/app/providers.tsx b/src/app/providers.tsx index b8a461c5..e039b47d 100644 --- a/src/app/providers.tsx +++ b/src/app/providers.tsx @@ -3,7 +3,7 @@ import posthog from 'posthog-js'; import { PostHogProvider } from 'posthog-js/react'; -if (typeof window !== 'undefined') { +if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_POSTHOG_KEY) { posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { api_host: 'https://events.httptoolkit.tech', autocapture: false, // We don't need events here - just page views is fine.