Zendesk Chat widget status check

1k Views Asked by At

I am using the Zendesk chat widget on my web portal. My requirement is whenever the widget goes down from server "Zendesk site" check the status and send notification to site owner.

On the research I found the $zopim.livechat.setOnStatus(callback); method. But the disadvantage of this gives only the offline and online status.

1

There are 1 best solutions below

0
On

The "Status" that is checked with the callback function setOnStatus will only ever refer to the actual chat status rather than a technical health check status.

It's a little clunky, but if you're expecting the widget to load, but it doesn't due to the service being down, you could do a manual check after a given time, and have a reporting callback (Dummy function your_error_callback):

// Check Zopim (Zendesk Chat) status after 10 seconds
var ZopimHealthCheck = setInterval(function () {
    if (window.$zopim === undefined || window.$zopim.livechat === undefined) {
        your_error_callback("Zendesk Chat not available");
    }
    clearInterval(ZopimHealthCheck);
}, 10000);