Skip to content

feat(audience): add 30-minute rolling session ID to core#2814

Closed
nattb8 wants to merge 1 commit intomainfrom
feat/sdk-42-rolling-session-id
Closed

feat(audience): add 30-minute rolling session ID to core#2814
nattb8 wants to merge 1 commit intomainfrom
feat/sdk-42-rolling-session-id

Conversation

@nattb8
Copy link
Copy Markdown
Contributor

@nattb8 nattb8 commented Apr 3, 2026

Summary

  • Adds a session.ts module to @imtbl/audience-core that generates a UUID session ID with a 30-minute rolling inactivity timeout, stored in localStorage
  • Includes sessionId in EventContext so it flows through to im-data-cdp on every event
  • Adds getSessionId(), resetSession() exports and SESSION_TIMEOUT_MS config constant

Test plan

  • Unit tests for session creation, rolling timeout refresh, expiry, and manual reset
  • Verify session ID appears in events sent to audience service in dev environment

Closes SDK-42

🤖 Generated with Claude Code

Adds a session module that generates a UUID session ID stored in localStorage.
The session rolls: each event refreshes the 30-minute inactivity timeout.
Session ID is included in EventContext so it flows through to im-data-cdp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nattb8 nattb8 requested a review from a team as a code owner April 3, 2026 05:29
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 3, 2026

View your CI Pipeline Execution ↗ for commit d398fe0

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

☁️ Nx Cloud last updated this comment at 2026-04-03 05:43:42 UTC

@nattb8 nattb8 closed this Apr 3, 2026
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.

1 participant