Skip to content

events add --platform web: print trackEvent instead of a raw POST /v1/event - #9

Merged
bazingga08 merged 2 commits into
mainfrom
feat/web-trackevent-1105
Nov 5, 2026
Merged

bazingga08 merged 2 commits into
mainfrom
feat/web-trackevent-1105

Conversation

@bazingga08

Copy link
Copy Markdown
Contributor

Why

@straitlink/web now has trackEvent (strait-sdk-web#15, ADR 0002), the same call as the app SDKs. The web snippet was the only one printing a hand-written request and its own localStorage tap-id code.

What

  • src/events.mjs: web snippet = reportWebOpen(strait) on load + await trackEvent(strait, '<name>'), with the same revenue hint as React Native (value, currency, eventId).
  • Tests first (red: the snippet still printed fetch(//v1/event/localStorage), then green. README, CHANGELOG Unreleased, ADR 0001 update note.

Evidence

  • npm test: 89 pass, 0 fail, 2 skipped (existing).
  • The printed snippet compiles with tsc --strict against the sdk-web branch; a trackEvnt typo control fails (TS2552).

Release order

The snippet needs the web SDK release that adds trackEvent: publish @straitlink/web first, then this CLI (both in ops/run-1105/sdk-release-plan.md). Not published here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfkGWSV4ar1AEGgGnCbGzd

bazingga08 and others added 2 commits November 5, 2026 16:37
…f a raw POST /v1/event

The web SDK now has trackEvent (strait-sdk-web#15, ADR 0002), so the web snippet uses the same call as
every other platform; the SDK keeps the tap id itself (no localStorage code in the snippet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfkGWSV4ar1AEGgGnCbGzd
@bazingga08
bazingga08 merged commit 607b5ea into main Nov 5, 2026
4 checks passed
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