Skip to content

Commit

Permalink
Skip PH setup if the key isn't set, for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Dec 4, 2024
1 parent da2c2d9 commit 2d30ebc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2d30ebc

Please sign in to comment.