Skip to main content
npm i @bryel/feedback

recordFeedback

recordFeedback(options): Promise<{ accepted: number }>
apiKey
string
required
Project API key. Keep it server-side.
target
object
required
What the feedback attaches to.
kind
"thumb" | "score" | "comment" | "correction" | "label"
required
The shape of the signal.
score
number
1/0 for a thumb, or a scalar.
label
string
Categorical tag, or a raw thumb token.
comment
string
Free text; also where a correction payload goes.
name
string
default:"user"
The feedback dimension (e.g. helpfulness) — record multiple named signals per target.
source
"end_user" | "labeler" | "model_judge" | "code"
default:"end_user"
Who/what produced it.
userId
string
The subject of the run; also the default annotator.
annotatorId
string
default:"userId"
Who gave the feedback (a reviewer/labeler) — defaults to userId.
sessionId
string
Denormalized session id, for message targets.
metadata
Record<string, string>
Arbitrary string tags stored with the signal.
id
string
Idempotency id. Server-generated if omitted; latest write wins.
endpoint
string
default:"https://ingest.bryel.ai/v1/feedback"
Override the feedback endpoint (self-hosting).
Writes are latest-wins per (target, name, source, annotator, kind) — re-recording the same dimension updates it rather than duplicating.

Shorthands

thumbsUp(options)    // kind: "thumb", score: 1
thumbsDown(options)  // kind: "thumb", score: 0
recordFeedbackBatch({ apiKey }, items) // record many in one POST