Skip to content

Commit 2d30ebc

Browse files
committed
Skip PH setup if the key isn't set, for local testing
1 parent da2c2d9 commit 2d30ebc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/providers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import posthog from 'posthog-js';
44
import { PostHogProvider } from 'posthog-js/react';
55

6-
if (typeof window !== 'undefined') {
6+
if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_POSTHOG_KEY) {
77
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
88
api_host: 'https://events.httptoolkit.tech',
99
autocapture: false, // We don't need events here - just page views is fine.

0 commit comments

Comments
 (0)