Essentially I am trying to ensure that the chatbot is completely cleared and refreshed upon page load and when the user closes the chat. I feel like the code I have written in the above file should do this according to the Conversations API documentation. However I am finding two problems:
The conversation history is kept on page load (though if I refresh the page more than once, then the conversation history does dissappeear)
The conversationClosed event never seems to fire. (I am assuming it should fire when a user clicks the X to close the chat window).