@capgo/capacitor-intercom

May 11, 2026 ยท View on GitHub

Capgo - Instant updates for Capacitor

โžก๏ธ Get Instant updates for your App with Capgo

Missing a feature? We'll build the plugin for you ๐Ÿ’ช

Intercom Capacitor plugin

Why Capacitor Intercom?

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. hideInAppMessages on 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.

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/intercom/

Compatibility

Plugin versionCapacitor compatibilityMaintained
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.

Install

npm install @capgo/capacitor-intercom
npx cap sync

Configuration

Add 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().

iOS

The Intercom iOS SDK (~> 19.0) is included automatically via CocoaPods or Swift Package Manager.

Push Notifications

  1. Disable Intercom's auto push integration โ€” Add this to your Info.plist to prevent conflicts with Capacitor's push handling:
<key>IntercomAutoIntegratePushNotifications</key>
<false/>
  1. Forward the device token to Capacitor โ€” In your AppDelegate.swift:
import UIKit
import Capacitor

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        return true
    }

    func application(_ application: UIApplication,
                     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        // Forward to Capacitor โ€” the plugin's observer picks this up
        // and sends the token to Intercom automatically
        NotificationCenter.default.post(
            name: .capacitorDidRegisterForRemoteNotifications,
            object: deviceToken
        )
    }

    func application(_ application: UIApplication,
                     didFailToRegisterForRemoteNotificationsWithError error: Error) {
        NotificationCenter.default.post(
            name: .capacitorDidFailToRegisterForRemoteNotifications,
            object: error
        )
    }
}
  1. Register for push and handle notification taps โ€” In your app's JavaScript:
import { PushNotifications } from '@capacitor/push-notifications';
import { CapgoIntercom as Intercom } from '@capgo/capacitor-intercom';

// Request permission + register
const perm = await PushNotifications.requestPermissions();
if (perm.receive === 'granted') {
  await PushNotifications.register();
}

// Auto-forward FCM token to Intercom
PushNotifications.addListener('registration', async (token) => {
  await Intercom.sendPushTokenToIntercom({ value: token.value });
});

// When user taps a notification, tell Intercom to open the conversation
PushNotifications.addListener('pushNotificationActionPerformed', async (action) => {
  const data = action.notification?.data;
  // iOS uses 'intercom_push_type', Android uses 'receiver'
  if (data?.intercom_push_type || data?.receiver === 'intercom_sdk') {
    await Intercom.receivePush(data);
  }
});

Note: The plugin automatically registers the APNs device token with Intercom when it detects .capacitorDidRegisterForRemoteNotifications. You must still upload your APNs Authentication Key (.p8) in the Firebase Console under Project Settings โ†’ Cloud Messaging โ†’ APNs Authentication Key.

Android

The Intercom Android SDK (17.4.2) is included automatically via Gradle.

Push Notifications

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.

  1. Create your own FirebaseMessagingService in 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
    }
}
  1. 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.

API

loadWithKeys(...)

loadWithKeys(options: IntercomLoadOptions) => Promise<void>

Initialize Intercom with API keys at runtime. Use this if you prefer not to configure keys in capacitor.config.

ParamType
optionsIntercomLoadOptions

registerIdentifiedUser(...)

registerIdentifiedUser(options: IntercomIdentifiedUserOptions) => Promise<void>

Register a known user with Intercom. At least one of userId or email must be provided.

ParamType
optionsIntercomIdentifiedUserOptions

registerUnidentifiedUser()

registerUnidentifiedUser() => Promise<void>

Register an anonymous user with Intercom.


updateUser(...)

updateUser(options: IntercomUserUpdateOptions) => Promise<void>

Update user attributes in Intercom.

ParamType
optionsIntercomUserUpdateOptions

logout()

logout() => Promise<void>

Log the user out of Intercom.


logEvent(...)

logEvent(options: IntercomLogEventOptions) => Promise<void>

Log a custom event in Intercom.

ParamType
optionsIntercomLogEventOptions

displayMessenger()

displayMessenger() => Promise<void>

Open the Intercom messenger.


displayMessageComposer(...)

displayMessageComposer(options: IntercomMessageComposerOptions) => Promise<void>

Open the message composer with a pre-filled message.

ParamType
optionsIntercomMessageComposerOptions

displayHelpCenter()

displayHelpCenter() => Promise<void>

Open the Intercom help center.


hideMessenger()

hideMessenger() => Promise<void>

Hide the Intercom messenger.


displayLauncher()

displayLauncher() => Promise<void>

Show the Intercom launcher button.


hideLauncher()

hideLauncher() => Promise<void>

Hide the Intercom launcher button.


displayInAppMessages()

displayInAppMessages() => Promise<void>

Enable in-app messages from Intercom.


hideInAppMessages()

hideInAppMessages() => Promise<void>

Disable in-app messages from Intercom.


displayCarousel(...)

displayCarousel(options: IntercomCarouselOptions) => Promise<void>

Display a specific Intercom carousel.

ParamType
optionsIntercomCarouselOptions

displayArticle(...)

displayArticle(options: IntercomArticleOptions) => Promise<void>

Display a specific Intercom article.

ParamType
optionsIntercomArticleOptions

displaySurvey(...)

displaySurvey(options: IntercomSurveyOptions) => Promise<void>

Display a specific Intercom survey.

ParamType
optionsIntercomSurveyOptions

setUserHash(...)

setUserHash(options: IntercomUserHashOptions) => Promise<void>

Set the HMAC for identity verification.

ParamType
optionsIntercomUserHashOptions

setUserJwt(...)

setUserJwt(options: IntercomUserJwtOptions) => Promise<void>

Set JWT for secure messenger authentication.

ParamType
optionsIntercomUserJwtOptions

setBottomPadding(...)

setBottomPadding(options: IntercomBottomPaddingOptions) => Promise<void>

Set the bottom padding for the Intercom messenger UI.

ParamType
optionsIntercomBottomPaddingOptions

sendPushTokenToIntercom(...)

sendPushTokenToIntercom(options: IntercomPushTokenOptions) => Promise<void>

Send a push notification token to Intercom.

ParamType
optionsIntercomPushTokenOptions

receivePush(...)

receivePush(notification: IntercomPushNotificationData) => Promise<void>

Handle a received Intercom push notification.

ParamType
notificationIntercomPushNotificationData

getUnreadConversationCount()

getUnreadConversationCount() => Promise<IntercomUnreadCountResult>

Get the number of unread conversations for the current user.

Returns: Promise<IntercomUnreadCountResult>


addListener('windowDidShow', ...)

addListener(eventName: 'windowDidShow', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for when the Intercom window is shown.

ParamType
eventName'windowDidShow'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>


addListener('windowDidHide', ...)

addListener(eventName: 'windowDidHide', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for when the Intercom window is hidden.

ParamType
eventName'windowDidHide'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>


addListener('unreadCountDidChange', ...)

addListener(eventName: 'unreadCountDidChange', listenerFunc: (data: IntercomUnreadCountResult) => void) => Promise<PluginListenerHandle>

Listen for changes in the unread conversation count.

ParamType
eventName'unreadCountDidChange'
listenerFunc(data: IntercomUnreadCountResult) => void

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all event listeners.


Interfaces

IntercomLoadOptions

PropType
appIdstring
apiKeyIOSstring
apiKeyAndroidstring

IntercomIdentifiedUserOptions

PropType
userIdstring
emailstring

IntercomUserUpdateOptions

PropType
userIdstring
emailstring
namestring
phonestring
languageOverridestring
customAttributes{ [key: string]: any; }
companiesIntercomCompany[]

IntercomCompany

PropType
companyIdstring
namestring
planstring
monthlySpendnumber
createdAtnumber
customAttributes{ [key: string]: any; }

IntercomLogEventOptions

PropType
namestring
data{ [key: string]: any; }

IntercomMessageComposerOptions

PropType
messagestring

IntercomCarouselOptions

PropType
carouselIdstring

IntercomArticleOptions

PropType
articleIdstring

IntercomSurveyOptions

PropType
surveyIdstring

IntercomUserHashOptions

PropType
hmacstring

IntercomUserJwtOptions

PropType
jwtstring

IntercomBottomPaddingOptions

PropType
valuenumber

IntercomPushTokenOptions

PropType
valuestring

IntercomPushNotificationData

IntercomUnreadCountResult

PropType
countnumber

PluginListenerHandle

PropType
remove() => Promise<void>