You can modify the Web Widget (Classic) behavior using JavaScript APIs by applying specific workflows at different times. Some workflows should be executed when a department's status changes, while others should be run when the widget first connects or reconnects.
For example, you can hide the widget on page load and then show it when an unread message appears. Additionally, you can use thechat:connected
callback for commands you want to run only once, and thechat:departmentStatus
callback for commands that should execute whenever a department's status changes. This flexibility allows you to tailor the widget's behavior to your specific needs. For more details, check out the originalZendesk article.
The timing of applying widget settings in Web Widget (Classic) API workflows is crucial. Some settings should be applied when a department's status changes, while others should be applied when the widget first connects or reconnects. For instance,…
Thechat:connected
callback in Web Widget (Classic) is best used for commands you only wish to execute once. This is ideal for initial setup tasks that should not be repeated every time the widget reconnects. If you have commands that need to be…
Handling department status changes in Web Widget (Classic) can be managed using thechat:departmentStatus
callback. This allows you to apply specific settings based on the department's availability. For example, if a department named 'CRM' is…
Hiding the Web Widget (Classic) on page load is not strictly necessary, but it can be part of your workflow if desired. The initial steps of hiding the widget and then showing it when an unread message appears can be omitted without affecting the…