@bryel/feedback, secret key) or straight from the browser (@bryel/browser, publishable key). Both are zero-dependency.
Kinds and targets
A π with a written note is a
thumb (score: 0) plus a comment. Free-text feedback the user typed about the whole conversation is a comment on a session target.
Server (secret key)
Use a secret key (bk_β¦) from your backend. It has no origin requirement.
comment on a session target:
Browser (publishable key)
@bryel/browser re-exports the same recordFeedback. In the browser, use a publishable key (bkp_β¦): it is write-only and origin-locked, so it is safe to ship in your client bundle β no backend proxy required. The /v1/feedback endpoint is CORS-enabled and accepts a bkp_ key sent from an allowed origin, the same model as browser traces.
Joining feedback to a trace
Feedback arrives after the answer, sotarget.id must be an id that also exists on the trace. Two options:
- Reuse the id your tracing already produced. If each turn already has a stable id on its trace (the id you set as
metadata.messageId, or a per-turn event id), pass that astarget.id. No new id to mint β this is what the Framer integration does. - Mint one if you donβt have it. Otherwise create a
messageIdper turn, stamp it into telemetry metadata, and return it to the client.
1
Mint, stamp, and return on the server
2
Record feedback against that id
messageId upstream in the first place, see the Vercel instrumentation guide.