Skip to content

fix: map non-prod hosts to staging Amplitude#179

Merged
jomifepe merged 1 commit intomainfrom
jp/amplitude-host-fix
May 8, 2026
Merged

fix: map non-prod hosts to staging Amplitude#179
jomifepe merged 1 commit intomainfrom
jp/amplitude-host-fix

Conversation

@jomifepe
Copy link
Copy Markdown
Contributor

@jomifepe jomifepe commented May 7, 2026

Summary

  • Development environments previously threw The Amplitude service is only supported in: prismic.io, wroom.io during flag lookup.
  • Amplitude only has prod and staging, so route any non-prismic.io host to the staging endpoint/key (same pattern as Segment in tracking.ts).
  • Also fixes the server URL — non-prod hosts no longer try to hit a non-existent amplitude.<host>, they hit amplitude.wroom.io.

🤖 Generated with Claude Code


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Note

Medium Risk
Changes how feature-flag/variant data is resolved by altering host→key/URL mapping; misrouting could cause flags to be fetched from the wrong Amplitude environment.

Overview
Adjusts Amplitude variant-data requests to treat any non-prismic.io host as staging: getAmplitudeApiKey no longer throws for unknown hosts and always returns the Wroom key, and getAmplitudeServiceUrl now maps explicitly to either amplitude.prismic.io (prod) or amplitude.wroom.io (staging) instead of constructing amplitude.<host>.

Reviewed by Cursor Bugbot for commit 60b82f1. Bugbot is set up for automated code reviews on this repo. Configure here.

Wroom-variant hosts (dev-tools-wroom.com, marketing-tools-wroom.com,
etc.) previously threw because only prismic.io and wroom.io were
accepted. Amplitude only has prod and staging, so route anything that
isn't prismic.io to the staging endpoint, mirroring the Segment
pattern in tracking.ts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jomifepe jomifepe self-assigned this May 7, 2026
@jomifepe jomifepe marked this pull request as ready for review May 7, 2026 15:04
@jomifepe jomifepe merged commit 4d981f8 into main May 8, 2026
13 checks passed
@jomifepe jomifepe deleted the jp/amplitude-host-fix branch May 8, 2026 12:29
@github-actions github-actions Bot mentioned this pull request May 8, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants