Repository navigation
feat: add audience collection mode - #15
Merged
Merged
Conversation
2 tasks done
Server SDKs do not rewrite $url, $referer, or $viewport and need no audience-specific transport, cookie, redirect, or credential isolation. Drop that code, its tests, the unrelated py.typed marker and formatting churn, and shorten the docs.
Member
Author
|
Scope change following the spec update: server-tier audience mode is now only the wire shape ( |
leonkenneth
approved these changes
Nov 9, 2026
robinvrd
approved these changes
Nov 9, 2026
francoischalifour
added a commit
that referenced
this pull request
Nov 9, 2026
## What Ignore the `environment` constructor argument. It is now `Optional[str]` and still accepted positionally or by name so existing calls keep working, but it is ignored, not stored on the client, and emits no warning. A single helper strips top-level `environment` from track, identify, and alias requests, including raw batches, without mutating caller dictionaries or removing nested business properties. README gains a short note on the deprecation. ## Why An environment-bound Product Analytics API key now selects the destination. Callers using unbound legacy keys must replace them before upgrading. Stacked on #15 (audience collection); this PR contains only the environment slice. ## Checklist - [x] Public client tests cover that the argument is accepted silently, omission of `environment` from track/identify/alias and batch requests, preserved nested properties, and caller input ownership. - [x] Changelog and README updated; the compatibility impact (unbound keys require migration) is documented.
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
Add immutable
mode="audience"for single events and raw batches. Audience events send onlymode,event,timestamp, andproperties; the client's mode cannot be overridden by per-event options or batch entries, and caller dictionaries are not mutated.identify()andalias()returnNonesilently without sending a request, anddistinct_idis not required. Caller properties pass through unchanged. Product mode remains the default and drops any top-levelmodefield from batch entries. An invalid mode raisesValueError.TrackingModeis exported, and the client exposes a read-onlymodeproperty.Why
Server callers need restricted event collection without product identifiers. Custom properties remain the application's responsibility, and server HTTP context does not represent individual visitors.
Checklist