Skip to content

Set posthog runtimeConfig defaults (follow-up to #429)#430

Merged
razbakov merged 1 commit into
mainfrom
fix/posthog-runtime-config
Apr 15, 2026
Merged

Set posthog runtimeConfig defaults (follow-up to #429)#430
razbakov merged 1 commit into
mainfrom
fix/posthog-runtime-config

Conversation

@razbakov
Copy link
Copy Markdown
Collaborator

@razbakov razbakov commented Apr 15, 2026

Follow-up to #429.

#429 added the public key to the module-level posthog: block, but runtimeConfig.public.posthog still defaulted to empty strings. At runtime those empty strings override the module config when Vercel env vars aren't set, so the deployed __NUXT__.config.public.posthog shows publicKey:"" and PostHog never initializes.

Set the same public phc_ key in runtimeConfig so both layers agree.

Verified after #429 deployed: curl https://v4.wedance.vip/ | grep posthog shows publicKey:"". This PR fixes that.

Summary by CodeRabbit

  • Chores
    • Updated PostHog integration configuration with production environment settings.

PR #429 set the module-level posthog.publicKey but runtimeConfig.public.posthog
still defaulted to empty strings, which override the module config at runtime
when Vercel env vars are unset. Result: deployed __NUXT__.config.public.posthog
showed publicKey:'' and the client never initialized.

Set the same public phc_ key here so both layers agree.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v4 Ready Ready Preview, Comment Apr 15, 2026 1:19am

Request Review

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Updated PostHog analytics configuration in nuxt.config.ts by populating the publicKey and host fields with specific values for EU-region analytics collection. The change transitions from placeholder empty strings to production configuration values.

Changes

Cohort / File(s) Summary
PostHog Configuration
nuxt.config.ts
Updated runtimeConfig.public.posthog.publicKey and runtimeConfig.public.posthog.host with production values for EU region analytics.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Fix PostHog tracking on v4.wedance.vip #429: Modifies the identical nuxt.config.ts PostHog configuration entries with the same publicKey and host values.
  • Posthog #412: Updates PostHog runtime configuration in nuxt.config.ts for the same posthog.host and posthog.publicKey structure.

Poem

🐰 A rabbit hops through config land,
PostHog keys in paw so grand,
EU analytics now take flight,
Empty strings replaced just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: setting PostHog runtime configuration defaults and explicitly references the related issue #429.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/posthog-runtime-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@razbakov razbakov merged commit 54f731e into main Apr 15, 2026
2 of 5 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Released in v4 Launch Apr 15, 2026
@razbakov razbakov deleted the fix/posthog-runtime-config branch April 15, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

1 participant