Terminating chat session from client side

Say a version 1.0 webchat widget is currently initialized and/or actively connected to an agent. Is there a proper way to programatically terminate a version 1.0 Webchat widget from the client side using Javascript?

Hello,

As far as I know, it it not possible with Widget v.10.
There is no exposed method (via javascript) which allows to end the chat session on the customer side. The customer needs to click on the End Chat button.

As a side note, with Widgets v2 (using PureCloud WebChat v2), it is possible to terminate the session programmatically (invoking a WebChat command to end the chat).

Regards,

Ok, but I have experimented with removing the chat from the DOM using javascript and react. If I contain a 1st chat widget in a React component and then dismount/remove the container from the DOM, it will immediately terminate the interaction in the geneys console. By that, I mean the text on the left side of the console immediately goes from red to green, which is what we want to do. But when create a 2nd widget using the same means, dismounting again removes the iframe from the DOM but has no effect on the status of the chat in the genesys console (it stays green).

Conversely, if I open devtools and use vanilla javascrit from the dom, it will kill the interaction for a 1st widget, but after that, I cannot open another chat in my application. It seems the 'chatContainer' id has been removed somehow.

Both of these situations do exactly what we want half the time. It seems like there should be something I can change that will result in consistent behavior. Can you please explore the matter further and see if maybe there is a solution that does not involve migrating to the version 2 chat?

Jerome's correct, v1.0 doesn't provide this functionality. The new versions provide additional functionality that you are looking for - version 1.1 and version 2.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.