Skip to content

feat(audience): remove identify(traits) overload from Web SDK (SDK-224)#2866

Merged
nattb8 merged 1 commit into
mainfrom
feat/sdk-224-remove-identify-traits-overload
Apr 28, 2026
Merged

feat(audience): remove identify(traits) overload from Web SDK (SDK-224)#2866
nattb8 merged 1 commit into
mainfrom
feat/sdk-224-remove-identify-traits-overload

Conversation

@nattb8
Copy link
Copy Markdown
Contributor

@nattb8 nattb8 commented Apr 28, 2026

Summary

  • Removes the traits-only identify(traits) overload from the Web SDK public surface, matching the Unity SDK revert in SDK-222 / PR Use moduleNameMapper [NO-CHANGELOG] #696
  • Collapses the overloaded implementation into a single identify(userId, identityType, traits?) method — no more runtime type-dispatch
  • Removes the "Update traits" panel from the sample app and cleans up all references in tests and docs

Why

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

File Change
packages/audience/sdk/src/sdk.ts Remove identify(traits) overload + simplify implementation
packages/audience/sdk/src/sdk.test.ts Remove 3 tests covering the removed overload
packages/audience/sdk-sample-app/index.html Remove "Update traits" accordion section
packages/audience/sdk-sample-app/sample-app.js Remove onIdentifyTraits handler and button wiring
packages/audience/sdk-sample-app/README.md Remove traits-only step from walkthrough

Test plan

  • jest — 60/60 tests pass
  • tsc --noEmit — no type errors
  • Confluence doc updates (Web SDK Event Reference, Implementation Plan) — tracked in SDK-224

Linear

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 pass identityType (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 collapses identify() to a single identify(id, identityType, traits?) signature, eliminating runtime type-dispatch and ensuring identify events always include an identityType.

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.

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>
@nattb8 nattb8 requested a review from a team as a code owner April 28, 2026 06:43
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 28, 2026

View your CI Pipeline Execution ↗ for commit 59dcf22

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-28 06:44:22 UTC

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 28, 2026

View your CI Pipeline Execution ↗ for commit 59dcf22

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 13s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-28 06:44:29 UTC

@github-actions
Copy link
Copy Markdown

✅ Audience Bundle Size — @imtbl/audience

Metric Size Delta vs main (f79e3dc)
Gzipped 18249 bytes (17.82 KB) -40 bytes
Raw (minified) 53041 bytes -162 bytes

Budget: 24.00 KB gzipped (warn at 20.00 KB)

@nattb8 nattb8 changed the title [BREAKING] feat(audience): remove identify(traits) overload from Web SDK (SDK-224) feat(audience): remove identify(traits) overload from Web SDK (SDK-224) Apr 28, 2026
@nattb8 nattb8 added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 78b6311 Apr 28, 2026
11 of 14 checks passed
@nattb8 nattb8 deleted the feat/sdk-224-remove-identify-traits-overload branch April 28, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants