Skip to main content
Record user feedback against a generation or session β€” the substrate for evals and fine-tuning datasets. Send it from your server (@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.
Session-level typed feedback uses a 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.
Only publishable bkp_ keys belong in client code. Never ship a secret bk_ key to the browser β€” proxy those through your backend.

Joining feedback to a trace

Feedback arrives after the answer, so target.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 as target.id. No new id to mint β€” this is what the Framer integration does.
  • Mint one if you don’t have it. Otherwise create a messageId per 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

To capture the messageId upstream in the first place, see the Vercel instrumentation guide.