DevOps·6 min read

Embed a Bot & Go Live

Make a bot public, embed it on your site, and ship it to real users — with keys, monitoring, and quotas handled.

Embed a Bot & Go Live

You've tested a bot. Here's how to put it in front of real users on your website or app.

1. Make the bot public

Open the bot and mark it public. Public bots can be called from the browser through the CORS chat endpoint without exposing a server-side key — the right choice for a website widget.

2. Embed on your site

Under Developer → Embed, grab the snippet for your bot. Drop it into your page and the chat widget renders for visitors. For a custom UI, call the chat endpoint directly:

javascript
const res = await fetch("https://bothive.cloud/api/v1/chat", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": "bh_public_safe_key" }, body: JSON.stringify({ botId: "your-bot-id", message: userText, history }), });

3. Manage keys

Create a dedicated key per surface (site, mobile, internal) under Developer → API Keys so you can rotate one without breaking the others. See API keys & authentication.

4. Monitor what's happening

  • Live Logs (Developer → Live Logs) — watch requests and errors in real time.
  • Analytics / Insights — track volume, success rate, and latency.
  • Usage — see credit consumption against your monthly pool.

5. Mind your quotas

Every run is rate-limited and metered against your plan, billed to the key's owner. Handle 429 responses with backoff, and upgrade under Billing when sustained traffic needs more headroom.

Going further

Quick tip

Use the test pane to iterate quickly. Every change you make is live — no need to save first.

Important

API keys are shown only once. Store them securely and never commit them to version control.

Best practice

Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.

Pro tip

Chain multiple specialized bots in a workflow for better results than one general-purpose bot.

Embed a Bot & Go Live