Skip to content

Instantly share code, notes, and snippets.

@david-wb
Created August 13, 2021 01:16
Show Gist options
  • Save david-wb/d76def3c1cf1d5661fe303c5966393b9 to your computer and use it in GitHub Desktop.
Save david-wb/d76def3c1cf1d5661fe303c5966393b9 to your computer and use it in GitHub Desktop.
Handling Bavard Chat Window Events
<script>
(function () {
window.onBavardUserAction = function (userAction) {
if (userAction.utterance === "close") {
window.bavard.close();
} else if (userAction.utterance === "hideWidget") {
window.bavard.setVisibility(false);
} else if (userAction.utterance === "unload") {
window.unloadBavard();
}
};
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment