Skip to content

feat: add event enrichment client package#7029

Draft
ekjotmultani wants to merge 1 commit into
mainfrom
feat/event-enrichment-client
Draft

feat: add event enrichment client package#7029
ekjotmultani wants to merge 1 commit into
mainfrom
feat/event-enrichment-client

Conversation

@ekjotmultani

@ekjotmultani ekjotmultani commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Event Enrichment client for analytics — the on-device companion that stamps device/app/session/identity context onto events and emits a Pinpoint-compatible JSON envelope, so events sent via the Kinesis/Firehose clients keep the analytics context Pinpoint used to provide automatically.

This PR contains core package implementation only (lib files, no example, no tests). The example app and unit tests are in stacked PRs based on this branch.

PR Stack (3-way split)

PR Branch Content
This PR (#7029) feat/event-enrichment-client Core package (lib only — 22 files)
#7076 feat/event-enrichment-client-example Example app (92 files)
#7068 feat/event-enrichment-client-tests Unit tests (5 files)

Structure

Dart/Flutter split, mirroring the Kinesis packages:

  • amplify_event_enrichment_dart — pure-Dart core (client, EnrichedEvent, SessionManager, global fields, metadata, EventSink interface). No Flutter dependency.
  • amplify_event_enrichment — Flutter wrapper: lifecycle observer, SharedPreferencesClientIdProvider, injectable DeviceMetadataProvider, re-exports the core.

Built on v3 Amplify Foundation (amplify_foundation_dart, Result<T>, sealed exceptions, AmplifyLogging).

Key decisions

  • Shared device id: shared_preferences under com.amplifyframework.device_id, read-or-create — a cross-package contract shared with the Connect client (whichever inits first generates the UUID; the other reads it). Maps to native SharedPreferences/NSUserDefaults so a device gets one id everywhere.
  • Zero default dependencies: device_info_plus is not a core dependency; device metadata comes from an injectable DeviceMetadataProvider defaulting to dart:io Platform. The EventSink ships as an interface only (no default sinks) — keeps enrichment transport-agnostic.

Verification

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.23%. Comparing base (5d896ca) to head (b05a0ad).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7029      +/-   ##
==========================================
+ Coverage   43.22%   43.23%   +0.01%     
==========================================
  Files          99       99              
  Lines        7769     7769              
  Branches     3400     3401       +1     
==========================================
+ Hits         3358     3359       +1     
+ Misses       4411     4410       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cadivus

cadivus commented Jun 24, 2026

Copy link
Copy Markdown
Member

Please make sure to generate and commit workflows using aft for these new packages.

@ekjotmultani ekjotmultani force-pushed the feat/event-enrichment-client branch from 4954624 to b05a0ad Compare June 30, 2026 16:42
@ekjotmultani ekjotmultani changed the base branch from main to feat/amplify-push-v3 June 30, 2026 19:25
@ekjotmultani ekjotmultani changed the base branch from feat/amplify-push-v3 to main June 30, 2026 19:26
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.

3 participants