How do I keep the Chat History Accross Pages?
I'm creating a chat (Bubble) for the users inside my webpage, but the problem is that if the user change to another window or reload the page, the chat will be closed and the history erased. Is there a way to keep this?
5 Replies
did you try enabling https://docs.typebot.io/settings/remember-user#remember-user
Typebot Docs
Remember user - Typebot Docs
Yep I did. But I found the problem, it was the embed Code node, I enabled the "Wait for event?" flag after the Start node, but doing this way it wasn't returning the resultID from the startChat API route.
So to solve this, I put a 'Button' node after the start node, and then it worked, its now saving the history.
Start Node -> Button Node(Start chat) -> Embed Code Node (Wait for event? enabled)
Sorry I struggle to understand it did not work as expected when you have a Embed block with Wait for event option ON?
Can you explain exactly what you try and what happens?
Sure, no problem man.
I've a embed code on my chat. This embed code have buttons where you can click on it. After clicking on one of those buttons, I'll do some actions on my flow checking the "option" variable.
But for some reason, if I don't put the Button node("Start Chat"), the history its not saved in the Session Storage or Local Storage, even if you have the "Remember User" flag enabled.
So I checked the source code on github, and to be able to save the history on the browser, the first call of the api route (startChat) should return the resultID, and for some reason, when you have the embed code with the Wait for event enabled, this parameter is never being returned for the api.
I attached some images explaining how I solve this problem with the button "Click here to Start the Chat". But if I remove this button, and let just the Embed Code as the first thing, the history its never saved.



Well because there is nothing to save, you just display an Embed bubble!
We don't save what is inside the embed bubble, because we are not aware of it 😅