> ## Documentation Index
> Fetch the complete documentation index at: https://document.botsmith.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Embed the BotSmith Chat Widget on Your Website Now

> Add the BotSmith chat widget to any website with a one-line JavaScript snippet from your chatbot's Share tab — works on any platform or CMS.

The chat widget is the primary way to deploy your BotSmith agent on a website. A small JavaScript snippet loads a floating chat button on your page; visitors click it to open a full chat window powered by your agent. Both the snippet and a shareable public chat link are available from your chatbot's **Share** tab.

## Getting the Embed Code

<Steps>
  <Step title="Open your chatbot in BotSmith">
    Go to the BotSmith dashboard and open the chatbot you want to embed.
  </Step>

  <Step title="Click the Share tab">
    Click the **Share** tab at the top of the chatbot editor.
  </Step>

  <Step title="Copy the embed snippet">
    Under **Embed on Your Website**, click **Copy** to copy the JavaScript snippet to your clipboard.
  </Step>
</Steps>

## JavaScript Embed Snippet

The JavaScript snippet loads the BotSmith widget asynchronously so it never slows down your page. Paste it just before the closing `</body>` tag on every page where you want the widget to appear.

```html theme={null}
<!-- BotSmith Chat Widget -->
<script
  src="https://app.botsmith.ai/widget.js"
  chatbot-id="YOUR_CHATBOT_ID"
  domain="https://app.botsmith.ai"
  defer>
</script>
```

Replace `YOUR_CHATBOT_ID` with the chatbot ID shown in your **Share** tab. The widget appears as a floating chat button in the corner of the page. Visitors click it to open the chat window and start a conversation with your agent.

<Note>
  The exact snippet shown in your Share tab already has your chatbot ID filled in
  — copy it directly from there rather than editing the snippet manually.
</Note>

## Public Share Link

If you want to share a standalone chat page rather than embed the widget, use the public chat link. It is also shown in your **Share** tab:

```
https://app.botsmith.ai/public-chat/YOUR_CHATBOT_ID
```

Send this URL in an email, a help article, or a social media post. Users open the link and start chatting immediately — no installation needed on their end.

## Testing Your Widget

1. Open your website in a browser after adding the snippet.
2. The chat bubble should appear in the corner of the page.
3. Click the bubble to open the chat window.
4. Send a test message and confirm your agent replies correctly.

If the widget does not appear, check the following:

* `YOUR_CHATBOT_ID` is replaced with your actual chatbot ID (no extra spaces or quotes).
* The `<script>` tag is placed before the closing `</body>` tag.
* Your chatbot is set to **Active** in BotSmith settings.

<Warning>
  Your chatbot must be set to **Active** and have **Public Access** enabled in
  the Share tab before the widget can respond. Visitors will see an error if
  either setting is off.
</Warning>
