We have multiple workspaces in Intercom. In the application, we want to change workspaces, without restart application. The official documentation says to use: Intercom.client().logout()
and then initialize Intercom again. But it does not work, and appKey and appId did not change. How can we do that?
From the Intercom documentation, I suspect what you try to achieve is not be possible. The documentation of logout
states it's only resetting the part about the user, not the full Intercom setup:
Logout is used to clear all local caches and user data the Intercom SDK has created. Use this at a time when you wish to log a user out of your app or change a user.
At least in the public API, there is no "unregister" to undo the creation of the Intercom
singleton instance done during the initialize
call. The only other methods I can see is registerForLaterInitialisation
but that sounds as if you still will only be able to afterwards initialize
once.
If you are looking for a way to trigger an app restart to switch, I've found the Phoenix Library useful to triggering a restart after internal testing settings have changed. But of course, it depends on your requirements since you already mentioned that you would like to achieve the switch without a restart.
You could add your question to the Intercom Forum, which seems to regularly get replies by their engineering team.