fix(audience): remove environment from public interfaces#2851
Merged
Conversation
The publishable key determines test vs production routing internally. Removes the Environment type and environment parameter from AudienceConfig, PixelInitOptions, SnippetOptions, and createConsentManager. getBaseUrl now routes by key prefix (pk_imapik-test-* → api.dev, all others → api.immutable.com). SDK-120 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pre-1.0 version signals interface instability before public release. SDK-120 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 9b55061
☁️ Nx Cloud last updated this comment at |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
getBaseUrl is no longer exported from core — MessageQueue resolves the ingest endpoint internally from the publishable key it already receives. SDK and pixel no longer import getBaseUrl or INGEST_PATH for URL construction. SDK-120 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nattb8
reviewed
Apr 14, 2026
…o MessageQueue Move flushIntervalMs, flushSize, INGEST_PATH, and CONSENT_PATH out of core's public exports and into MessageQueue/consent internals. SDK and pixel consumers no longer need to know about flush tuning or endpoint paths — they just pass a publishable key and optional overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test keys (pk_imapik-test-*) now route to api.sandbox.immutable.com (publicly accessible test infra) instead of api.dev.immutable.com. For internal dev environments behind VPN (e.g. Game Page), an optional baseUrl override is available on AudienceConfig and PixelInitOptions. When set it bypasses key-prefix routing entirely. This is intentionally omitted from snippet generation and public documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # packages/audience/pixel/src/snippet.ts
…getBaseUrl getBaseUrl stays focused on key-prefix routing. The baseUrl override is applied with a simple ?? at each call site (queue constructor and consent notifyBackend) rather than threading it through getBaseUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove references to internal infrastructure from public source code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nattb8
approved these changes
Apr 14, 2026
JCSanPedro
approved these changes
Apr 14, 2026
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
Environmenttype andenvironmentparameter from all public interfaces (AudienceConfig,PixelInitOptions,SnippetOptions,createConsentManager)getBaseUrl,INGEST_PATH,CONSENT_PATH,FLUSH_INTERVAL_MS, andFLUSH_SIZEare no longer exported from@imtbl/audience-core.MessageQueueandcreateConsentManagerresolve endpoints and defaults internally from the publishable keypk_imapik-test-*) route toapi.sandbox.immutable.com, all others toapi.immutable.combaseUrloverride onAudienceConfigandPixelInitOptionsfor custom endpoint routing (not exposed in snippet generation)MessageQueue, with optional overrides viaMessageQueueOptions@imtbl/pixelversion from1.0.0→0.1.0to signal alpha status before public releaseTest plan
@imtbl/metricsresolution issue in worktree is unrelated)environmentResolves SDK-120
🤖 Generated with Claude Code