Intercom Capacitor plugin
A fully re-implemented Intercom plugin for Capacitor 8, built to Capgo quality standards:
- Intercom iOS SDK 19+ - Latest Swift APIs with proper async handling
- Intercom Android SDK 17+ - Modern Intercom client integration
- Bug-free - Fixed known bugs from community implementations (e.g.
hideInAppMessageson Android) - Cross-platform - Consistent API across iOS and Android
- Full feature set - Messenger, Help Center, Articles, Carousels, Push, Identity Verification, and more
Essential for any app integrating Intercom for customer support, onboarding, or in-app messaging.
The most complete doc is available here: https://capgo.app/docs/plugins/intercom/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
npm install @capgo/capacitor-intercom
npx cap syncAdd your Intercom keys to your Capacitor config:
{
"plugins": {
"CapgoIntercom": {
"iosApiKey": "ios_sdk-xxx",
"iosAppId": "yyy",
"androidApiKey": "android_sdk-xxx",
"androidAppId": "yyy"
}
}
}Alternatively, you can initialize at runtime using loadWithKeys().
The Intercom iOS SDK (~> 19.0) is included automatically via CocoaPods or Swift Package Manager.
The Intercom Android SDK (17.4.2) is included automatically via Gradle.
Since Android only allows one FirebaseMessagingService, this plugin does not register its own. Instead it provides IntercomFcmHelper — a static helper you call from your app's service.
- Create your own
FirebaseMessagingServicein your app (e.g.app/src/main/java/.../MyFirebaseMessagingService.java):
package com.your.app;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import app.capgo.capacitor.intercom.IntercomFcmHelper;
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (IntercomFcmHelper.isIntercomPush(remoteMessage)) {
IntercomFcmHelper.onMessageReceived(this, remoteMessage);
} else {
// Handle other push SDKs (e.g. @capacitor/push-notifications)
// or your own notification logic here
}
}
@Override
public void onNewToken(String token) {
IntercomFcmHelper.onNewToken(this, token);
// Forward token to other SDKs if needed
}
}- Register it in your app's
AndroidManifest.xml:
<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>This approach is compatible with any other Firebase plugin — you control the routing.
loadWithKeys(...)registerIdentifiedUser(...)registerUnidentifiedUser()updateUser(...)logout()logEvent(...)displayMessenger()displayMessageComposer(...)displayHelpCenter()hideMessenger()displayLauncher()hideLauncher()displayInAppMessages()hideInAppMessages()displayCarousel(...)displayArticle(...)displaySurvey(...)setUserHash(...)setUserJwt(...)setBottomPadding(...)sendPushTokenToIntercom(...)receivePush(...)getUnreadConversationCount()addListener('windowDidShow', ...)addListener('windowDidHide', ...)addListener('unreadCountDidChange', ...)removeAllListeners()- Interfaces
loadWithKeys(options: IntercomLoadOptions) => Promise<void>Initialize Intercom with API keys at runtime. Use this if you prefer not to configure keys in capacitor.config.
| Param | Type |
|---|---|
options |
IntercomLoadOptions |
registerIdentifiedUser(options: IntercomIdentifiedUserOptions) => Promise<void>Register a known user with Intercom. At least one of userId or email must be provided.
| Param | Type |
|---|---|
options |
IntercomIdentifiedUserOptions |
registerUnidentifiedUser() => Promise<void>Register an anonymous user with Intercom.
updateUser(options: IntercomUserUpdateOptions) => Promise<void>Update user attributes in Intercom.
| Param | Type |
|---|---|
options |
IntercomUserUpdateOptions |
logout() => Promise<void>Log the user out of Intercom.
logEvent(options: IntercomLogEventOptions) => Promise<void>Log a custom event in Intercom.
| Param | Type |
|---|---|
options |
IntercomLogEventOptions |
displayMessenger() => Promise<void>Open the Intercom messenger.
displayMessageComposer(options: IntercomMessageComposerOptions) => Promise<void>Open the message composer with a pre-filled message.
| Param | Type |
|---|---|
options |
IntercomMessageComposerOptions |
displayHelpCenter() => Promise<void>Open the Intercom help center.
hideMessenger() => Promise<void>Hide the Intercom messenger.
displayLauncher() => Promise<void>Show the Intercom launcher button.
hideLauncher() => Promise<void>Hide the Intercom launcher button.
displayInAppMessages() => Promise<void>Enable in-app messages from Intercom.
hideInAppMessages() => Promise<void>Disable in-app messages from Intercom.
displayCarousel(options: IntercomCarouselOptions) => Promise<void>Display a specific Intercom carousel.
| Param | Type |
|---|---|
options |
IntercomCarouselOptions |
displayArticle(options: IntercomArticleOptions) => Promise<void>Display a specific Intercom article.
| Param | Type |
|---|---|
options |
IntercomArticleOptions |
displaySurvey(options: IntercomSurveyOptions) => Promise<void>Display a specific Intercom survey.
| Param | Type |
|---|---|
options |
IntercomSurveyOptions |
setUserHash(options: IntercomUserHashOptions) => Promise<void>Set the HMAC for identity verification.
| Param | Type |
|---|---|
options |
IntercomUserHashOptions |
setUserJwt(options: IntercomUserJwtOptions) => Promise<void>Set JWT for secure messenger authentication.
| Param | Type |
|---|---|
options |
IntercomUserJwtOptions |
setBottomPadding(options: IntercomBottomPaddingOptions) => Promise<void>Set the bottom padding for the Intercom messenger UI.
| Param | Type |
|---|---|
options |
IntercomBottomPaddingOptions |
sendPushTokenToIntercom(options: IntercomPushTokenOptions) => Promise<void>Send a push notification token to Intercom.
| Param | Type |
|---|---|
options |
IntercomPushTokenOptions |
receivePush(notification: IntercomPushNotificationData) => Promise<void>Handle a received Intercom push notification.
| Param | Type |
|---|---|
notification |
IntercomPushNotificationData |
getUnreadConversationCount() => Promise<IntercomUnreadCountResult>Get the number of unread conversations for the current user.
Returns: Promise<IntercomUnreadCountResult>
addListener(eventName: 'windowDidShow', listenerFunc: () => void) => Promise<PluginListenerHandle>Listen for when the Intercom window is shown.
| Param | Type |
|---|---|
eventName |
'windowDidShow' |
listenerFunc |
() => void |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'windowDidHide', listenerFunc: () => void) => Promise<PluginListenerHandle>Listen for when the Intercom window is hidden.
| Param | Type |
|---|---|
eventName |
'windowDidHide' |
listenerFunc |
() => void |
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'unreadCountDidChange', listenerFunc: (data: IntercomUnreadCountResult) => void) => Promise<PluginListenerHandle>Listen for changes in the unread conversation count.
| Param | Type |
|---|---|
eventName |
'unreadCountDidChange' |
listenerFunc |
(data: IntercomUnreadCountResult) => void |
Returns: Promise<PluginListenerHandle>
removeAllListeners() => Promise<void>Remove all event listeners.
| Prop | Type |
|---|---|
appId |
string |
apiKeyIOS |
string |
apiKeyAndroid |
string |
| Prop | Type |
|---|---|
userId |
string |
email |
string |
| Prop | Type |
|---|---|
userId |
string |
email |
string |
name |
string |
phone |
string |
languageOverride |
string |
customAttributes |
{ [key: string]: any; } |
companies |
IntercomCompany[] |
| Prop | Type |
|---|---|
companyId |
string |
name |
string |
plan |
string |
monthlySpend |
number |
createdAt |
number |
customAttributes |
{ [key: string]: any; } |
| Prop | Type |
|---|---|
name |
string |
data |
{ [key: string]: any; } |
| Prop | Type |
|---|---|
message |
string |
| Prop | Type |
|---|---|
carouselId |
string |
| Prop | Type |
|---|---|
articleId |
string |
| Prop | Type |
|---|---|
surveyId |
string |
| Prop | Type |
|---|---|
hmac |
string |
| Prop | Type |
|---|---|
jwt |
string |
| Prop | Type |
|---|---|
value |
number |
| Prop | Type |
|---|---|
value |
string |
| Prop | Type |
|---|---|
count |
number |
| Prop | Type |
|---|---|
remove |
() => Promise<void> |
