chore: disable PostHog telemetry in development mode (#1365)

* chore: disable PostHog telemetry in development mode

Skip posthog.init() when import.meta.env.DEV is true to avoid
sending telemetry data during local development.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: Rin <shinohara-rin@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rin
2026-03-15 09:39:54 +08:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 623f35a7e3
commit 688836912d
4 changed files with 20 additions and 16 deletions
+5 -4
View File
@@ -2,7 +2,8 @@ import posthog from 'posthog-js'
import { DEFAULT_POSTHOG_CONFIG, POSTHOG_PROJECT_KEY_DOCS } from '../../../posthog.config'
posthog.init(POSTHOG_PROJECT_KEY_DOCS, {
...DEFAULT_POSTHOG_CONFIG,
// Project-specific config...
})
if (!import.meta.env.DEV) {
posthog.init(POSTHOG_PROJECT_KEY_DOCS, {
...DEFAULT_POSTHOG_CONFIG,
})
}