These docs are for v0.0.1. Click to read the latest docs for v1.0.61.

Discussions

Ask a Question
Back to All

chat SDK - clean-up on navigate away

what's the recommended way of cleaning up when a user navigates away from the web page hosting the chat sdk?

i have an onunload=function() which attempts a chatEngagement.disconnect(); - the function runs but the disconnect never happens, my agent is left in a dead session.

since my onunload runs i don't hold out much hope for changing that to onbeforeunload, visibilitychange or pagehide...