feat(audience): remove identify(traits) overload from Web SDK (SDK-224)#2866
Merged
Merged
Conversation
The traits-only identify overload cannot carry an identityType, which is now mandatory on every identify event for CDP data-deletion matching. Removes the overload, its runtime dispatch logic, related tests, and all sample-app UI that exposed it, keeping parity with the Unity SDK revert in SDK-222. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 59dcf22
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 59dcf22
☁️ Nx Cloud last updated this comment at |
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
ImmutableJeffrey
approved these changes
Apr 28, 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
identify(traits)overload from the Web SDK public surface, matching the Unity SDK revert in SDK-222 / PR Use moduleNameMapper [NO-CHANGELOG] #696identify(userId, identityType, traits?)method — no more runtime type-dispatchWhy
The traits-only overload cannot carry an
identityType, which is now mandatory on every identify event so CDP data-deletion requests can match records to the correct identity namespace. An identify event without a type cannot be cleaned up.Changes
packages/audience/sdk/src/sdk.tsidentify(traits)overload + simplify implementationpackages/audience/sdk/src/sdk.test.tspackages/audience/sdk-sample-app/index.htmlpackages/audience/sdk-sample-app/sample-app.jsonIdentifyTraitshandler and button wiringpackages/audience/sdk-sample-app/README.mdTest plan
jest— 60/60 tests passtsc --noEmit— no type errorsLinear
Closes SDK-224
🤖 Generated with Claude Code
Note
Medium Risk
Breaking API change:
identify(traits)is removed, so existing integrations and sample-app workflows must be updated to always passidentityType(and may silently lose trait-only updates until migrated). Runtime risk is otherwise contained to identity event construction and UI/test cleanup.Overview
Breaking change: removes the traits-only
identify(traits)overload from the Web SDK and collapsesidentify()to a singleidentify(id, identityType, traits?)signature, eliminating runtime type-dispatch and ensuring identify events always include anidentityType.Updates the sample app UI/docs to drop the “Update traits” panel and walkthrough step, removes the associated handler/button wiring, and deletes tests that asserted the old overload behavior.
Reviewed by Cursor Bugbot for commit 59dcf22. Bugbot is set up for automated code reviews on this repo. Configure here.