feat(audience): remove sandbox env routing, add testMode (SDK-357)#2872
Open
bkbooth wants to merge 2 commits into
Open
feat(audience): remove sandbox env routing, add testMode (SDK-357)#2872bkbooth wants to merge 2 commits into
bkbooth wants to merge 2 commits into
Conversation
Removes getBaseUrl() and the pk_imapik-test- prefix check that routed events to api.sandbox.immutable.com, which is being decommissioned. Adds testMode init option to both the pixel and SDK — when true, every outbound event carries a top-level test: true field so the backend can filter test data from production analytics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 484a5fd
☁️ Nx Cloud last updated this comment at |
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 13e8cf5. Configure here.
…EADMEs Updates the 8 stale sandbox URL assertions in consent.test.ts and queue.test.ts that bugbot flagged — they referenced api.sandbox URLs that no longer get produced after the getBaseUrl removal. Drops the Test Mode README sections. The option is for internal/non-prod use, similar to baseUrl which is also undocumented. Still discoverable via TypeScript IntelliSense. Co-Authored-By: Claude Sonnet 4.6 <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.

Summary
getBaseUrl()and thepk_imapik-test-key prefix check that routed events toapi.sandbox.immutable.com(being decommissioned). Default base URL is now alwayshttps://api.immutable.com; dev routing continues via the existingbaseUrloverride.testMode?: booleantoPixelInitOptionsandAudienceConfig. Whentrue, all outbound events carry a top-leveltest: truefield so the backend can filter test traffic from production analytics.Closes SDK-357. Sub-issue of SDK-351 (Sandbox Removal).
Changed files
core/src/config.tsTEST_KEY_PREFIX,getBaseUrl(). AddedBASE_URLconstant.core/src/config.test.tscore/src/types.tstest?: truetoBaseMessage.core/src/queue.tsBASE_URLinstead ofgetBaseUrl(publishableKey).core/src/consent.tsBASE_URLinstead ofgetBaseUrl(publishableKey).pixel/src/pixel.tstestModetoPixelInitOptions, instance property, andbuildBase().sdk/src/types.tstestModetoAudienceConfigwith JSDoc.sdk/src/sdk.tstestModeinstance property, wired intobaseMessage().pixel/README.mdsdk/README.mdTest plan
@imtbl/audience-coreunit tests pass@imtbl/pixelunit tests pass@imtbl/audienceunit tests passeslintpasses on all changed files (lint-staged ran at commit)test: truetop-level field is handled correctly on ingest🤖 Generated with Claude Code
Note
Medium Risk
Changes where events are sent by default (always
https://api.immutable.comunlessbaseUrlis overridden) and updates the event schema to optionally includetest: true, which could affect ingestion/analytics if backend handling or consumers aren’t aligned.Overview
Removes
getBaseUrl()/test-key prefix routing and standardizes core networking to useBASE_URL = https://api.immutable.comfor both ingest and consent sync (tests updated;config.test.tsdeleted), while still supporting explicitbaseUrloverrides.Adds
testMode?: booleanto both Pixel and Web SDK init configs; when enabled, all emitted messages include a top-leveltest: truefield (type updated in@imtbl/audience-core).Reviewed by Cursor Bugbot for commit 484a5fd. Bugbot is set up for automated code reviews on this repo. Configure here.