Sign In
Sign In
  1. Home
  2. APIs
  3. Widget Javascript API
  4. Widget events
APIs
37 articles
WhatsApp Push v1.03
Agent Handover v1.04
Data Compliance API4
Widget Javascript API4
Introduction
Available methods
Widget events
Widget Attributes
Message Trigger v1.12
Messaging v1.14

Widget events

Listen to widget events like loaded, send-message, and receive-message to trigger custom behavior on your website.

Updated on September 24, 2026

There are a few events produced by Laiye Chatbot's widget that should be listened to. These events can be used to implement particular behaviors on the website hosting the widget.

ℹ️ Note The following examples are illustrating the usage of events by using the Jquery library.

destygo_widget_loaded

The destygo_widget_loaded event is emitted at the document level and is triggered when the widget is done with initialization. It's useful to start listening to the other events at the right time.

Data available with this event:

  • detail.client_token : the unique token of the client using the widget

Example:

text
$(document).on('destygo_widget_loaded', function(event) {
    console.log('Widget for ' + event.detail.client_token + 'is ready');
})

destygo_send_message

The destygo_send_message event is emitted at the widget level (#destygo_widget id) and is triggered when the user sends a message.

Data available with this event:

  • detail.message : the message's text

Example:

text
$('#destygo_widget').on('destygo_send_message', function(event) {
    console.log('User has sent a message: ' + event.detail.message);
})

destygo_receive_message

The destygo_receive_message event is emitted at the widget level (#destygo_widget id) and is triggered when the user receives a message.

Data available with this event:

  • detail.message : the message's text

Example:

text
$('#destygo_widget').on('destygo_receive_message', function(event) {
    console.log('User has received a message: ' + event.detail.message);
})

destygo_click_on_toggler

The destygo_click_on_toggler event is emitted at the widget level (#destygo_widget id) and is triggered when the user clicks on the toggler, whether it's to open or close the widget.

Data available with this event:

  • detail.action : value is open if the click is to open the widget, otherwise the value is close

Example:

text
$('#destygo_widget').on('destygo_click_on_toggler', function(event) {
    console.log('Widget toggled: ' + event.detail.action);
})

destygo_click_on_contact

The destygo_click_on_contact event is emitted at the widget level (#destygo_widget id) and is triggered when the the user clicks on the contact button in the header.

Data available with this event:

  • detail.client_token : the unique token of the client using the widget

Example:

text
$('#destygo_widget').on('destygo_click_on_contact', function(event) {
    console.log('User ' + event.detail.client_token + ' has clicked on Contact button');
})

destygo_zendesk_triggered

The destygo_zendesk_triggered event is emitted at the widget level (#destygo_widget id) and is triggered when the initialization between the widget and Zendesk is complete. This event is made for the use of setZendeskUserInfo function.

Example :

text
$('#destygo_widget').on('destygo_zendesk_triggered', function(event) {
    const payload = {
        email: 'user@gmail.com',
        display_name: 'User name',
        phone: '0600000000'
    };
    DestygoChat.setZendeskUserInfo(payload)
})

Was this article helpful?

On this page
  • destygo_widget_loaded
  • destygo_send_message
  • destygo_receive_message
  • destygo_click_on_toggler
  • destygo_click_on_contact
  • destygo_zendesk_triggered

Made from France 💙

Categories

  • ANALYTICS
  • BUILD
  • LOUIS AI
  • INTEGRATE

🔗 Useful Links

  • Sign In
  • Website
  • Terms & Conditions

© 2026

MindsayPowered by Mindsay

Search the help center…

Search help center articles