Skip to content

client.events: track your users' events, and list them by stream - #62

Merged
bruel-gabrielsson merged 1 commit into
devfrom
feat/events-track-list
Oct 27, 2026
Merged

bruel-gabrielsson merged 1 commit into
devfrom
feat/events-track-list

Conversation

@bruel-gabrielsson

Copy link
Copy Markdown
Contributor

Replaces #52, keeping only what 0.6.5 (#57) did not already ship.

  • client.events.track(user_id, event, catalog_id=, timestamp=, user=) posts to /v1/events and returns the event id. user= is the User that complete takes. The catalog is catalog_id=, else the one an Item names, else the client's default; an Order over two catalogs is refused. Orders get a cart_id and unit_selling_price 0 as the API stores them; a naive timestamp is refused.
  • client.events.list(user_id=, limit=, types=, stream=) reads /v1/events/own. stream= is new since Tracked users: client.events.track and .list, user_id= on complete and sections #52 (unbox-api deploy/behaviorgpt), and is how an app opened from the portal reads the streams it was opened on. TrackedEvent carries stream.
  • The async client gets both.
  • README: a paragraph under "Who the shopper is"; the portal-app skill says how to read streams.

Dropped from #52: user_id= on complete/sections and the "user_id or history, not both" rule. 0.6.5 shipped user_id= adding stored events to the history instead.

#52 said to hold the release until events were on for the BehaviorGPT deployment. They are: the portal runs with EVENTS_ENABLED against it. Checked live, read only: events.list() returns the account's events with their streams, and stream= filters to one.

Tests: 14 in tests/test_events.py; 240 pass; ruff clean.

🤖 Generated with Claude Code

…em by stream

What is left of #52 that 0.6.5 did not already do. `events.track` posts to
/v1/events, with `user=` as in `complete`, and the catalog an `Item` names.
`events.list` reads /v1/events/own, now with `stream=`: a publishable key,
"api", or an import, which is how an app opened from the portal reads the
streams it was opened on. `user_id=` on `complete` and `sections` stays as
0.6.5 shipped it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bruel-gabrielsson
bruel-gabrielsson merged commit be9497f into dev Oct 27, 2026
3 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