user you pass to the provider sets the subject for frequency caps, resume, and persisted rows, and its traits drive targeting and branching.
Identified users
Your stable user identifier. Becomes the
user_id on persisted runs and the
key for once_per_user caps and resume.Arbitrary values for audience targeting and branch conditions, addressed as
traits.<key> in when clauses.Anonymous visitors
Omituser (or pass no id) and the runtime mints a stable per-browser anonymous id, persisted in localStorage, so caps and resume work before sign-in.
- The id survives reloads a returning visitor keeps one identity.
- Anonymous users carry
traits.anonymous === true. Target them withwhen: { "traits.anonymous": true }, or exclude them. - Read or reuse it directly:
Targeting with traits
Traits flow intowhen conditions on triggers and step branches:
traits.intent) and branch on it. See the server classifier.
Linking to the server SDK
The runtime persists experiences byuser.id only it has no conversation id and no backend channel. To tie a person’s experiences to their LLM activity, pass the same user.id to FirstflowProvider and to your server-side calls.
The conversation id (called sessionId on the server) is separate: your own chat code owns it and passes it to the server SDK to group a transcript. The provider is not involved.