11
Embed
Your assistant files the report. The widget is the fallback.
If the product already has an assistant, people should report a problem by talking to it. The assistant asks the one question ChangeBox would have asked in the widget, and files the change with the same capture: route, breadcrumbs, console errors, screenshot, viewport, user agent, environment, and build SHA. Sign the current user with the app identity secret. ChangeBox maps that email to a member when it matches someone on the team, and otherwise stores a guest reporter.
No assistant on the page? Keep the widget. It is the same capture and the same question, with the cards drawn for you. Widget.
import { createIntake } from "@changebox/intake";
const cb = createIntake({
appKey: "cb_live_xxx",
apiUrl: "https://changebox.ai",
identity, // signHostIdentity on your server
environment: "dev",
build: process.env.NEXT_PUBLIC_COMMIT,
});
cb.install();
const tools = [
{ name: "changebox_report", description: "File the problem. If the result has question, ask it verbatim.", parameters: { type: "object", properties: { description: { type: "string" }, expected: { type: "string" } }, required: ["description"] } },
{ name: "changebox_answer", description: "Send the user's answer.", parameters: { type: "object", properties: { changeId: { type: "string" }, text: { type: "string" } }, required: ["changeId", "text"] } },
{ name: "changebox_status", description: "Plain-language state, such as fixed on dev, waiting for release.", parameters: { type: "object", properties: { changeId: { type: "string" } }, required: ["changeId"] } },
];
async function call(name, args) {
if (name === "changebox_report") return cb.report({ description: args.description, expected: args.expected }, await cb.capture());
if (name === "changebox_answer") return cb.answer(args.changeId, args.text);
return cb.status(args.changeId);
}report returns {changeId} or {changeId, question}. answer continues. status is a sentence, for example “Fixed on dev, waiting for release.” The same three calls are MCP tools: changebox_intake_report, changebox_intake_answer, changebox_intake_status. Browser apps can POST /api/intake with the widget key. Servers with a bearer token POST /api/v1/intake.