Pega Chat client side script to check if chat is ended
We would like to perform some action on the website once the Pega chat is ended. We tried with following script with 'chatEnded' event . This doesn't seem to be working. Any idea what might be wrong here?
fireflyChatAPI.ready(function(){
fireflyChatAPI.chatHub.on({scope: 'chatHub', type: 'chatEnded'}, function() {
alert("Chat Ended");
});
})