SDK Methods
Complete reference for every method on KiBeeClient.
init()
Initialize the SDK, mount the renderer, and start a session. Call once before any other method.
await kibee.init();identifyPage(pageId)
Tell KiBee which page the user is on. Call this on every route change. The pageId links sessions and flows to the correct page context.
kibee.identifyPage("checkout");registerTargets(targets)
Register an array of targets for the current page. Replaces any previously registered targets for this page. See Target Registration for the full shape.
kibee.registerTargets([
{ id: "card-number", label: "Card number", target: { kibeeId: "card-number" } },
{ id: "pay-btn", label: "Pay button", target: { kibeeId: "pay-btn" } },
]);runFlow(flowId)
Start a guided flow by ID. The bee flies to each target in sequence. Returns a promise that resolves when the flow completes.
await kibee.runFlow("checkout-flow");runInteractiveFlow(flowId)
Same as runFlow but waits for the user to complete each step before advancing. The bee holds position until the expected interaction occurs (click, input, etc.).
await kibee.runInteractiveFlow("onboarding-flow");ask(query)
Match a free-text query to the best available flow using semantic intent matching. Returns an IntentMatch with the matched flow ID, confidence score, and a response message.
const match = await kibee.ask("how do I invite my team?");
// match.flowId → "invite-team-flow"
// match.confidence → 0.91
// match.message → "I'll guide the invite team flow."
if (match.flowId) {
await kibee.runInteractiveFlow(match.flowId);
}speak(message)
Display a message in the bee's speech bubble without running a flow. Useful for confirmations, status updates, or inline tips.
kibee.speak("Your account has been saved.");setDockAssistPanel(enabled)
Show or hide the assist panel attached to the dock button. When true, clicking the bee opens the panel with flows, bookmarks, and a free-text ask input.
kibee.setDockAssistPanel(true);listBookmarks()
Returns all honey and sting bookmarks recorded during the current session. Honey bookmarks are saved successful paths; sting bookmarks are friction points.
const bookmarks = kibee.listBookmarks();
const honey = bookmarks.filter(b => b.kind === "honey");
const sting = bookmarks.filter(b => b.kind === "sting");removeBookmark(id)
Delete a bookmark by ID.
kibee.removeBookmark("bkmk_abc123");DOM events
The SDK dispatches custom events on window:
| Event | Fired when |
|---|---|
kibee-assist-toggle | User opens or closes the assist panel |
kibee-flow-start | A guided flow begins |
kibee-flow-complete | Flow reaches end_flow with status completed |
kibee-flow-abandon | Flow ends without completion (timeout or user dismiss) |