feat: Add chatwoot:error sdk event (#3998)

This commit is contained in:
Muhsin Keloth
2022-02-21 09:40:11 +05:30
committed by GitHub
parent 3b015d4dd8
commit 7ba24b90c4
12 changed files with 59 additions and 29 deletions

View File

@@ -36,14 +36,18 @@ window.chatwootSettings = {
})(document,"script");
window.addEventListener('chatwoot:ready', function() {
console.log(window.$chatwoot);
console.log('chatwoot:ready', window.$chatwoot);
if (window.location.search.includes('setUser')) {
window.$chatwoot.setUser('<%= user_id %>', {
identifier_hash: '<%= user_hash %>',
identifier_hash: 'a<%= user_hash %>',
email: 'jane@example.com',
name: 'Jane Doe',
phone_number: ''
});
}
})
window.addEventListener('chatwoot:error', function(e) {
console.log('chatwoot:error', e.details)
})
</script>