Skip to main content
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

1

Open your chatbot in BotSmith

Go to the BotSmith dashboard and open the chatbot you want to embed.
2

Click the Share tab

Click the Share tab at the top of the chatbot editor.
3

Copy the embed snippet

Under Embed on Your Website, click Copy to copy the JavaScript snippet to your clipboard.

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.
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.
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.
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:
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.
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.