deploy: PostHog token injected at build from a repository variable (Vercel sensitive env pulled as "[SENSITIVE]") - #2542
Merged
Conversation
…ariable; vercel pull hands sensitive env vars back as the literal "[SENSITIVE]" and that string shipped as the PostHog token since 2026-08-24 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJgbZCqjR4nvCfcJSzofbw
Flotapponnier
added a commit
that referenced
this pull request
Sep 20, 2026
…ariable; vercel pull hands sensitive env vars back as the literal "[SENSITIVE]" and that string shipped as the PostHog token since 2026-08-24 (#2542) (#2543) Claude-Session: https://claude.ai/code/session_01HJgbZCqjR4nvCfcJSzofbw (cherry picked from commit 1425bc8) Co-authored-by: Flotapponnier <florent@mobula.io> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of PostHog receiving nothing since 2026-08-24: both deploy workflows run
vercel pullthenvercel build; Vercel returns env vars flagged Sensitive as the literal string[SENSITIVE], and that string was compiled into the client bundle as the PostHog token (posthog.init("[SENSITIVE]", …)on production today). PostHog accepts the event at ingest and drops it silently, so nothing failed loudly.Fix: the project token (public by nature, it ships to every browser) is a GitHub repository variable
NEXT_PUBLIC_POSTHOG_KEY(set), passed asenvto the build steps;process.envtakes precedence over the pulled.envfile. The OCB PostHog project (org Openchainbench, id 619165) currently holds zero events over 90 days.Needs the same change on
mainfor production (prod-deploy.ymlruns frommain).🤖 Generated with Claude Code
https://claude.ai/code/session_01HJgbZCqjR4nvCfcJSzofbw