Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re initialize Intercom in Application

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?

like image 323
Rasul Avatar asked Aug 07 '26 00:08

Rasul


1 Answers

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.

like image 86
sunadorer Avatar answered Aug 09 '26 12:08

sunadorer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!