Triggering Chat from Button on Website

Auto-open your bot on a predefined workflow

You may want to open the chat from a button on your website. All you need to do is add an onClick event and choose your desired outcome.

Swivl.goToQuest(“XXXXXXXX”);

This will open the chat and start the conversation on the specific quest you set. (Replace the XXXX’s with the quest ID you want to trigger)

Swivl.open();

This will simply open the chat

Swivl.close();

This will simply close the chat

Swivl.toggle();

This will toggle the chat. If the chat is currently open, it will close. If it is closed, it will open.
 
Here is an example of usage:
<button onclick="Swivl.toggle();">Click me</button>