Skip to content

feat: include identity info in pseudo identity event payloads#95

Open
khushi1033 wants to merge 1 commit into
developmentfrom
feat/identity-event-user-context
Open

feat: include identity info in pseudo identity event payloads#95
khushi1033 wants to merge 1 commit into
developmentfrom
feat/identity-event-user-context

Conversation

@khushi1033
Copy link
Copy Markdown
Contributor

@khushi1033 khushi1033 commented May 12, 2026

Summary

Adds user_identities and user_attributes to individual identity event payloads (login, logout, modify_user, identify). Previously these fields were intentionally omitted from individual events since they exist on mparticle_batch in the metadata envelope. The requirement has changed and events need to carry this context individually for how they are consumed downstream.

Both fields are placed inside event.data (event-specific payload), following the Gateway TransactionEvent contract. user_attributes is snapshotted at callback time via the existing handleIdentityComplete ordering, so each event reflects the user state at the moment of the identity transition. user_identities has the emailsha256 key remapping applied before being set on the event.

Testing Plan

What has been tested

212/212 unit tests passing. Updated existing tests to assert data.user_identities and data.user_attributes. New tests added covering:

  • Populated identities on login
  • emailsha256 key remapping
  • Populated user attributes on login
  • Per-event attribute snapshot across multiple sequential callbacks
  • Empty identities and attributes on anonymous logout

Screenshots

Before
Screenshot 2026-05-12 at 5 08 55 PM

After
Screenshot 2026-05-12 at 5 06 31 PM

@khushi1033 khushi1033 changed the base branch from main to development May 12, 2026 20:38
@khushi1033 khushi1033 marked this pull request as ready for review May 12, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant