Gorgias logo
Gorgias logo

All articles

Check if the Chat is open or closedUpdated 10 months ago

This suggestion isn't an official feature of our Chat widget, so our support for it is limited - we recommend that it be implemented by someone with a technical background.


You can use the following method to determine whether the Chat is in an open or closed state:

1<script>
2var initGorgiasChatPromise = (window.GorgiasChat) ? window.GorgiasChat.init() : new Promise(function (resolve) { window.addEventListener('gorgias-widget-loaded', function () { resolve();})});
3
4initGorgiasChatPromise.then(function() {
5 GorgiasChat.isOpen() // Will return true or false.
6})
7</script>
Was this article helpful?
Yes
No