Legacy Dev Forum Posts

 View Only

Sign Up

End WebChat when browser disconnected

  • 1.  End WebChat when browser disconnected

    Posted 06-05-2025 18:23

    Maragatham | 2022-07-28 06:16:38 UTC | #1

    How to handle/properly end the webchat when a browser is closed by the customer


    jacobshaw | 2022-07-28 15:42:21 UTC | #2

    Hi @Maragatham, Not sure how you would detect that the customer has closed the browser, but you can programmatically disconnect the chat and set the wrapup code using the API resource PATCH /api/v2/conversations/chats/{conversationId}/participants/{participantId}. From a client-side javascript standpoint in the site hosting the web chat widget, you could use event handling and timeouts to implement the decision making for when the chat should be disconnected, e.g. - after 10 minutes of no messages received, disconnect the chat.


    Maragatham | 2022-07-28 16:38:49 UTC | #3

    jacobshaw, post:2, topic:15716
    javascript standpoint in the site hosting the web chat widget, you could use event handling and timeouts to implement the decision making for when the chat should be disconnected, e.g. - after 10 minutes of no

    Do we have any sample of events that can be used to capture the browser disconnect from client-side in Javascript of web chat widget.


    system | 2022-08-28 16:38:37 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 15716