Skip to content

feat: enrich event stream with Kit userAttributes#79

Merged
alexs-mparticle merged 6 commits intodevelopmentfrom
almondine-snowplow
Mar 25, 2026
Merged

feat: enrich event stream with Kit userAttributes#79
alexs-mparticle merged 6 commits intodevelopmentfrom
almondine-snowplow

Conversation

@mattbodle
Copy link
Copy Markdown
Collaborator

Summary

  • Events sent to Rokt's __event_stream__ now include the Kit's current userAttributes as the UserAttributes property on each event
  • Uses mergeObjects to create a shallow copy, so the original event is never mutated
  • Kit's own self.userAttributes is used as the authoritative source (always fresh, covers queued events before user identification)

Test plan

  • Existing event stream tests updated to account for new UserAttributes property
  • New test: enriches event with Kit userAttributes before sending
  • New test: overrides stale event UserAttributes with current Kit state
  • New test: does not mutate the original event object
  • New test: sends empty UserAttributes when Kit has none
  • All 262 tests pass (Chrome + Firefox)

🤖 Generated with Claude Code

Events sent to Rokt's __event_stream__ now include the Kit's current
userAttributes as the UserAttributes property. This ensures user
attributes are always fresh (sourced from the Kit's own state rather
than potentially stale per-event data) and present even for queued
events that were created before user identification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexs-mparticle alexs-mparticle changed the base branch from main to development March 25, 2026 14:04
Merge origin/development into almondine-snowplow, combining:
- PR: enrich event stream with Kit userAttributes
- development: defensive queue for event stream, session ID passing,
  setIntegrationAttribute, and logSelectPlacementsEvent fix

The enrichment now applies to both live and queued events via a shared
_enrichEvent helper that merges userAttributes into a copy of each event.
Dist files are generated by CI, not committed manually.
@alexs-mparticle alexs-mparticle merged commit 7c27cd3 into development Mar 25, 2026
4 of 5 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 25, 2026
# [1.19.0](v1.18.1...v1.19.0) (2026-03-25)

### Bug Fixes

* Update adblock measurement target origin ([#68](#68)) ([8a524c2](8a524c2))

### Features

* add /verify skill and AGENTS.md for agent guidance ([#69](#69)) ([21134b0](21134b0)), closes [hi#level](https://github.com/hi/issues/level)
* add defensive queue to _sendEventStream to prevent event loss ([#78](#78)) ([82b8dfc](82b8dfc))
* enrich event stream with Kit userAttributes ([#79](#79)) ([7c27cd3](7c27cd3))
@mparticle-automation
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants