How to clear conversation on bot hide
# 🤝help
c
Hi to everyone, I should build a functionality form my bot that clears the conversation when webchat is closed or when the user opens the bot from another page of the website. How can i do this? Thanks
f
Hey there, You could do something like this: window.botpressWebChat.onEvent( function (event) { if (event.type === 'UI.CLOSED') { sessionStorage.clear(); localStorage.clear(); } }, ['UI.CLOSED'] )
You would either clear the session storage or the local storage, it depends on where its stored for you