One app - multiple intercom api keys?

We have an mobile app that uses cordova-plugin-intercom. This works ok, but we have multiple partners whos users use our app SSO. We want to launch the intercom messenger with the intercom api-keys for respective partner. So user x, who logged in through partner Px, should start partner Px’s intercom chat when he/she need support. We can only set up one set of api keys in the config file though.

Is there any way to update api keys programmatically once the user has logged in and we know which partner’s intercom that should be launched?

Hey Mia :wave:

This can be possible by logging a user out of the SDK and reinitialising it with a different API key from another workspace. This isn’t recommended though, and may not work flawlessly as our mobile SDK wasn’t designed to accommodate this.

That said, I’ve passed your use-case over to the product team, and flagged it as a feature request :+1:

I hope that helps!

Hello, and thanks for your reply!

I don’t think I understand what you mean. Once the user has logged in on our app (before registering in intercom), we know which partner this user belongs to and which api keys and (intercom) user id we would like to use with intercom. But the intercom api keys are set in the config. I have not found a way neither to add another set of keys nor to reinitialize?

Can you point me in the direction of some documentation on how to reinitialize?

Oh, I thought I searched long and hard before asking this question. However, now I stumbled upon this: Can we change the ApiKey- AppId dynamically from iOS after login?

I’ll try this out. Thanks again!

But no, since I’m using cordova plugin, there is no Intercom.setApiKey. So the question remains. :slight_smile:

Hey @dvmia :wave:

Our Cordova plugin is basically just a wrapper for our iOS and Android SDK so everything possible in those SDKs should be possible using Cordova.

This includes setting a Mobile API Key: