JS Widget SDK
The widget SDK allows you to run the Botsquad chat widget on your site.
Installation and configuration¶
Please consult the Chat widget documentation on how to install and configure the widget for your website.
API¶
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.
BotSqd.openChat()
¶
Open the chat widgets when it was closed.
BotSqd.closeChat()
¶
Closes the chat widget when it was open.
BotSqd.setUserId(id)
¶
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.
BotSqd.getUserId()
¶
Retrieve the current user id that will be sent to Botsquad.