From dbdd14493b05ae502380762d50a53369b124fd34 Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:25:15 +0530 Subject: [PATCH] [WEB-662] chore: posthog debugging based on env variable (#3860) * chore: posthog debugging based on env variable * updated turbo.json * chore: true to 1 --------- Co-authored-by: gurusainath --- turbo.json | 1 + web/lib/posthog-provider.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/turbo.json b/turbo.json index bd5ee34b5..9302a7183 100644 --- a/turbo.json +++ b/turbo.json @@ -16,6 +16,7 @@ "NEXT_PUBLIC_DEPLOY_WITH_NGINX", "NEXT_PUBLIC_POSTHOG_KEY", "NEXT_PUBLIC_POSTHOG_HOST", + "NEXT_PUBLIC_POSTHOG_DEBUG", "JITSU_TRACKER_ACCESS_KEY", "JITSU_TRACKER_HOST" ], diff --git a/web/lib/posthog-provider.tsx b/web/lib/posthog-provider.tsx index e8c1b7899..c5acd2957 100644 --- a/web/lib/posthog-provider.tsx +++ b/web/lib/posthog-provider.tsx @@ -45,6 +45,7 @@ const PostHogProvider: FC = (props) => { if (posthogAPIKey && posthogHost) { posthog.init(posthogAPIKey, { api_host: posthogHost || "https://app.posthog.com", + debug: process.env.NEXT_PUBLIC_POSTHOG_DEBUG === "1", // Debug mode based on the environment variable autocapture: false, capture_pageview: false, // Disable automatic pageview capture, as we capture manually });