Find the answer you are looking for

Ending the Session in Embedded Windows

You can close an embedded chat window using $aivo.chat.close() or by adding resetWindow=true to the URL.
Both options allow you to end the session, although each has particularities that may be more convenient depending on the use case.

↗ With $aivo.chat.close(), the session is closed by executing JavaScript code in the application. When this method is invoked, the chat is closed completely, and the window is no longer visible to the user. In other words, it minimizes the chat window and ends the current session, deleting the history, then displays the chat initiator again.

↗ On the other hand, the option of adding resetWindow=true to the URL offers a simpler operation without the need for code.

When accessing with this parameter, the chat session ends automatically, the history is deleted, and the initial message is displayed again, but the window remains open and visible. This ensures a smooth experience and is especially useful in mobile applications where the close button is not enabled, preventing the screen from going blank.

To configure it, modify the URL of your embedded chat by adding ?resetWindow=true at the end. For example: https://embed.agentbot.net/TOKEN?resetWindow=true

➡ In summary, while $aivo.chat.close() closes and hides the chat window, resetWindow=true restarts the session while keeping the chat active and visible. The choice between one option or the other will depend on whether you want to hide the chat or keep it available for a new conversation to start without additional programming.

📚 Learn about Different actions to execute in the SDK.


This website stores cookies on your computer. These cookies are used to collect information about how you interact with our website and allow us to remember you. We use this information in order to improve and customize your browsing experience and for analytics and metrics about our visitors both on this website and other media. To find out more about the cookies we use, see our Privacy Policy.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference not to be tracked.