feat(audience): add transport, queue, and context collection to core#2813
Merged
feat(audience): add transport, queue, and context collection to core#2813
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 96b29ec
☁️ Nx Cloud last updated this comment at |
bkbooth
reviewed
Apr 2, 2026
bkbooth
previously approved these changes
Apr 2, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bkbooth
approved these changes
Apr 2, 2026
JCSanPedro
approved these changes
Apr 2, 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.
What this adds
The transport, batched queue, and context collection modules that complete
@imtbl/audience-core. These sit on top of the types/utils/config/storage/cookie from SDK-33 and give the web SDK (SDK-30) and pixel everything they need to send events.transport.ts — HTTP POST to the audience API with
x-immutable-publishable-keyheader. Returns boolean success for v1 (the audience service returns{ success, accepted, rejected }but rejected messages indicate SDK bugs, not transient errors — revisit if debugging needs arise).queue.ts — Batched message queue with localStorage durability. Flushes on a timer or when the queue reaches
flushSize, whichever comes first. Failed flushes retry on the next cycle. Persisted messages survive page navigations and are restored on construction. Concurrent flush guard prevents races.context.ts — Collects device fingerprint signals that match the audience service
EventContextschema: userAgent, locale, timezone, screen resolution, page URL/path/referrer/title. IP is collected server-side by the audience service, not by the SDK.Updated index.ts exports for all new modules.
Out of scope
keepalivefetch for page unload (SDK-38, web SDK concern)Linear: https://linear.app/imtbl/issue/SDK-34
🤖 Generated with Claude Code