@bryel/feedback-browser
v0.1.1
Published
Record user feedback β π/π, scores, comments, corrections, labels β from the browser with a publishable (bkp_) key. Client-safe, no OTel, zero config.
Maintainers
Readme
@bryel/feedback-browser
Record user feedback β π/π, scores, comments, corrections, labels β straight from the browser, with a publishable key (bkp_β¦). The key is write-only and origin-locked, so it is safe to ship in your client bundle. No backend proxy, no OpenTelemetry.
For server-side feedback with a secret key, use @bryel/feedback.
Install
npm i @bryel/feedback-browserUse
import { createFeedbackClient } from "@bryel/feedback-browser";
const feedback = createFeedbackClient({ apiKey: "bkp_β¦" });
// π with a note on one turn
await feedback.thumbsDown({
target: { type: "message", id: messageId },
comment: "wrong colors",
sessionId,
});
// free-text feedback about the whole conversation
await feedback.comment({
target: { type: "session", id: sessionId },
comment: "Visual design: good\nTask completion: yes",
});Or call the standalone helpers with the key each time: recordFeedback, thumbsUp, thumbsDown.
Attaching to a trace
target.id must be an id that also exists on the trace. Reuse the id your tracing already produced (e.g. the messageId you set in telemetry metadata), or mint one per turn. See the feedback guide.
Kinds & targets
kind:thumbΒ·scoreΒ·commentΒ·correctionΒ·labeltarget.type:message(one turn) Β·session(the conversation)source:end_userΒ·labelerΒ·model_judgeΒ·code
