Below are the methods that you can use to interact with the Chatling widget.

You must wait for the widget script to load before calling these methods.

Open chatbot

Opens the chatbot, similar to when a user clicks the chat icon.

window.Chatling.open();

Minimize chatbot

Minimizes the chatbot, similar to when a user clicks the minimize button in the widget.

window.Chatling.minimize();

Pass custom data after launch

You can send custom values to the chatbot at any point after it’s loaded.

The method takes an object containing the variable names and values. You must make sure that the variables have been created in the builder and that the names match exactly.

To pass custom data during launch, read this guide.
window.Chatling.setVariables({
    "contact_name": "Rick Astley",
    "contact_email": "[email protected]",
    "age": 30
}, function(success, errorMessage) {
    if (!success) {
        // handle error
    }
});