Skip to content

JS Widget SDK

The widget SDK allows you to run the Botsquad chat widget on your site.


When you want to embed the BotSquad bot into your own site, you need to add a bit of Javascript to your site. Just above the closing </body> tag place the following tag:

<script data-botsquad='{"id":"1adc3f20-32e9-4376-a147-d9ef23ac8a4c"}' src=""></script>

where id is the id of your bot. You will also find this script tag in the Connect section of the studio.


Most settings that deal with the layout of the widget are configurable from the studio and cannot be specified from Javascript.


Once loaded the SDK exposes a global BotSqd object which has the following functions:

BotSqd.event(name, payload)

Send an event to the chat. The chat window needs to be opened already.


Open the chat widgets when it was closed.


Closes the chat widget when it was open.


Set the user ID that is to be used in the chat. This will re-open the chat window when the user id changes. When the widget it still closed, nothing happens.


Retrieve the current user id that will be sent to Botsquad.