{"record":{"id":"dec58964c64d0a21","repo":"BloopAI/vibe-kanban","slug":"posthog-api-key-or-endpoint-not-set-analytics-wil","errorCode":null,"errorMessage":"PostHog API key or endpoint not set. Analytics will be disabled.","messagePattern":"PostHog API key or endpoint not set\\. Analytics will be disabled\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/local-web/src/app/entry/Bootstrap.tsx","lineNumber":43,"sourceCode":"    integrations: [Sentry.tanstackRouterBrowserTracingIntegration(router)],\n  });\n  Sentry.setTag('source', 'frontend');\n}\n\nif (\n  import.meta.env.VITE_POSTHOG_API_KEY &&\n  import.meta.env.VITE_POSTHOG_API_ENDPOINT\n) {\n  posthog.init(import.meta.env.VITE_POSTHOG_API_KEY, {\n    api_host: import.meta.env.VITE_POSTHOG_API_ENDPOINT,\n    capture_pageview: false,\n    capture_pageleave: true,\n    capture_performance: true,\n    autocapture: false,\n    opt_out_capturing_by_default: true,\n  });\n} else {\n  console.warn(\n    'PostHog API key or endpoint not set. Analytics will be disabled.'\n  );\n}\n\n// In the Tauri desktop app, implement custom zoom (Cmd/Ctrl + =/–/0) via root\n// font-size scaling and block trackpad/touchpad pinch-to-zoom.\nif (isTauriApp()) {\n  initZoom();\n\n  document.addEventListener('keydown', (e) => {\n    const mod = e.metaKey || e.ctrlKey;\n    if (!mod) return;\n\n    if (e.key === '=' || e.key === '+') {\n      e.preventDefault();\n      zoomIn();\n    } else if (e.key === '-') {\n      e.preventDefault();","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/packages/local-web/src/app/entry/Bootstrap.tsx#L25-L61","documentation":"At bootstrap, the local web app initializes PostHog analytics only when both `VITE_POSTHOG_API_KEY` and `VITE_POSTHOG_API_ENDPOINT` are set in the Vite environment. When either is missing, it skips posthog.init and logs this console.warn; the app continues running with analytics disabled.","triggerScenarios":"Building or running `pnpm run local-web:dev` without VITE_POSTHOG_API_KEY or VITE_POSTHOG_API_ENDPOINT defined in `.env` / shell env; variables defined under a different prefix; using a `.env.local` not picked up; prod build from a machine without the env file.","commonSituations":"Fresh clone without copying `.env.example` to `.env`; self-hosted/local dev where telemetry is intentionally unset; CI builds lacking secret env vars; Vite server restarted before adding env vars (requires restart to pick them up).","solutions":["Set both VITE_POSTHOG_API_KEY and VITE_POSTHOG_API_ENDPOINT in your `.env` (or shell) and restart the dev server.","If analytics are intentionally unwanted, ignore the warning or silence it — the app functions normally.","Check for typos in variable names and confirm the `.env` file is in `packages/local-web/` or the workspace root that Vite loads."],"exampleFix":"// .env before\n# (no posthog vars)\n\n// .env after\nVITE_POSTHOG_API_KEY=phc_xxxxxxxxxxxx\nVITE_POSTHOG_API_ENDPOINT=https://us.i.posthog.com","handlingStrategy":"validation","validationCode":"const missing = [\n  !import.meta.env.VITE_POSTHOG_API_KEY && 'VITE_POSTHOG_API_KEY',\n  !import.meta.env.VITE_POSTHOG_API_ENDPOINT && 'VITE_POSTHOG_API_ENDPOINT',\n].filter(Boolean);\nif (missing.length) console.warn(`Analytics disabled: missing env vars: ${missing.join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy `.env.example` to `.env` after cloning and fill in the PostHog key/endpoint.","Wrap analytics env checks in a startup validation script that fails CI builds of production bundles when vars are absent.","Remember Vite env vars are baked at build/start time — restart `pnpm run local-web:dev` after editing `.env`."],"tags":["analytics","env-var","configuration"],"backgroundTag":"missing-env-var","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}