Configuration

All configuration is passed to KiBeeClient at construction time. None of the options require a server restart — you can swap renderers, update the API URL, or change credentials without re-deploying your app.

KiBeeClient options

OptionTypeRequiredDescription
rendererBeeRendererYesThe renderer that draws the bee. Use ThreeBeeRenderer from @kibee/renderer-three.
apiBaseUrlstringYesBase URL of your KiBee API, e.g. https://api.kibee.ai.
websiteIdstringRecommendedYour workspace public ID (starts with kb_ws_). Required for publishable-key auth.
publicKeystringRecommendedPublishable API key (starts with kb_pub_). Safe to embed in browser code.
localestringNoBCP 47 locale for bee speech (default: "en").

ThreeBeeRenderer options

OptionTypeDefaultDescription
dockPositionstring"bottom-right"Where the bee docks when idle. One of bottom-right, bottom-left, top-right, top-left.
dockSizenumber58Diameter of the dock button in pixels.
dockVariantstring"hive"Visual style of the dock. "hive" or "circle".
dockEnabledbooleantrueShow the dock button. Set false for fully programmatic control.
qualityTierstring"auto""auto" detects device capability. Override with "low", "medium", or "high".
enableShadowsbooleanfalseRender drop shadows under the bee. Disable on low-end devices.
motionModestring"auto""auto" respects prefers-reduced-motion. Use "full" or "minimal" to override.
assetUrlstring"/models/bee-runtime.glb"Path to the bee 3D asset. Override when self-hosting or using a CDN.

Full example

TypeScript
import { KiBeeClient } from "@kibee/sdk";
import { ThreeBeeRenderer } from "@kibee/renderer-three";

const kibee = new KiBeeClient({
  websiteId: process.env.NEXT_PUBLIC_KIBEE_WEBSITE_ID,
  publicKey: process.env.NEXT_PUBLIC_KIBEE_PUBLIC_KEY,
  apiBaseUrl: process.env.NEXT_PUBLIC_KIBEE_API_BASE ?? "https://api.kibee.ai",
  renderer: new ThreeBeeRenderer({
    assetUrl: "/models/bee-runtime.glb",
    dockPosition: "bottom-right",
    dockSize: 58,
    dockVariant: "hive",
    dockEnabled: true,
    qualityTier: "auto",
    enableShadows: false,
    motionMode: "auto",
  }),
});

await kibee.init();

Environment variables

Store credentials in environment variables. Both websiteId and publicKey are safe to expose in browser bundles — they are publishable credentials, not secret keys.

.env.local
NEXT_PUBLIC_KIBEE_WEBSITE_ID=kb_ws_your_workspace
NEXT_PUBLIC_KIBEE_PUBLIC_KEY=kb_pub_live_your_key
NEXT_PUBLIC_KIBEE_API_BASE=https://api.kibee.ai
Never expose your secret API key in browser code. Use the publishable key (kb_pub_) for the browser SDK. Secret keys are for server-to-server calls only.