We’re having an Intercom widget on all pages including unauthorized state. When users log in we call `update` with `user_id`, `email` and `name`. Widget is correctly updated, but if it was opened at least once for an unauthorized user then conversations are not refetched until the page is not reloaded in a browser. Though if you do not click a widget in unauthorized state and log in, then conversations will be fetched on widget click. Seems like `/messenger/web/conversations` API can be called only once which is confusing. Is it possible to refetch conversations after switching from visitor to a contact?
Conversations are not refetched after user is updated
Best answer by Emilygav
Hey there
To address the issue where conversations are not refetched after a user logs in, ensure that you properly shut down Intercom when a user's session ends. This can be done by calling Intercom('shutdown') when the user logs out.
This action clears the session and ensures that when a user logs in again, a fresh session is started, allowing conversations to be fetched correctly.
Additionally, if you are using a Single Page Application (SPA), consider calling the Intercom('update') method with new user data after login. This triggers the JavaScript to look for new messages for the current user and display them if they exist.
By implementing these steps, you should be able to refetch conversations after switching from a visitor to a contact.
Hope this helps 💪🏼
Join the Intercom Community 🎉
Already have an account? Login
Login to the community
No account yet? Create an account
Intercom Customers and Employees
Log in with SSOEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
