Skip to main content
@capgo/capacitor-intercom Communication Open source

Intercom Capacitor plugin

Integrate Intercom live chat, help center, and support workflows in your Capacitor app

Install

bun add @capgo/capacitor-intercom bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-intercom
  • pnpm add @capgo/capacitor-intercom
  • yarn add @capgo/capacitor-intercom

Guide

How to use Intercom in Capacitor

Test on device

Download the Capgo app, then scan the QR code.

Intercom plugin preview QR code

Using @capgo/capacitor-intercom

Intercom Capacitor plugin.

Install

bun add @capgo/capacitor-intercom
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapgoIntercom } from '@capgo/capacitor-intercom';

API at a glance

Method Description
loadWithKeys Initialize Intercom with API keys at runtime. Use this if you prefer not to configure keys in capacitor.config.
registerIdentifiedUser Register a known user with Intercom. At least one of userId or email must be provided.
registerUnidentifiedUser Register an anonymous user with Intercom.
updateUser Update user attributes in Intercom.
logout Log the user out of Intercom.
logEvent Log a custom event in Intercom.
displayMessenger Open the Intercom messenger.
displayMessageComposer Open the message composer with a pre-filled message.
displayHelpCenter Open the Intercom help center.
hideMessenger Hide the Intercom messenger.
displayLauncher Show the Intercom launcher button.
hideLauncher Hide the Intercom launcher button.
displayInAppMessages Enable in-app messages from Intercom.
hideInAppMessages Disable in-app messages from Intercom.
displayCarousel Display a specific Intercom carousel.
displayArticle Display a specific Intercom article.
displaySurvey Display a specific Intercom survey.
setUserHash Set the HMAC for identity verification.
setUserJwt Set JWT for secure messenger authentication.
setBottomPadding Set the bottom padding for the Intercom messenger UI.
sendPushTokenToIntercom Send a push notification token to Intercom.
receivePush Handle a received Intercom push notification.
getUnreadConversationCount Get the number of unread conversations for the current user.

Examples

loadWithKeys()

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.loadWithKeys({
  appId: 'app-id-123',
  apiKeyIOS: 'api-key-ios',
  apiKeyAndroid: 'api-key-android',
});

registerIdentifiedUser()

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerIdentifiedUser({
  userId: 'user-id-123',
  email: 'user@example.com',
});

registerUnidentifiedUser()

Register an anonymous user with Intercom.

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerUnidentifiedUser();

updateUser()

Update user attributes in Intercom.

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.updateUser({ userId: 'user-id-123' });

logout()

Log the user out of Intercom.

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.logout();

logEvent()

Log a custom event in Intercom.

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.logEvent({ name: 'example' });

The table above lists the 23 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Listen to events

addListener returns a handle. Call handle.remove() when the screen unmounts, or CapgoIntercom.removeAllListeners() to clear every listener.

Full reference

Keep going from Using @capgo/capacitor-intercom

If you are using Using @capgo/capacitor-intercom to plan native plugin work, connect it with @capgo/capacitor-intercom for the implementation detail in @capgo/capacitor-intercom, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.

FAQ

Intercom plugin FAQ

How do I install the Intercom plugin in a Capacitor app?

Run "bun add @capgo/capacitor-intercom" (or "npm install @capgo/capacitor-intercom"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-intercom" in your app code.

Does @capgo/capacitor-intercom work with React, Vue and Angular?

Yes. Intercom is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-intercom support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-intercom free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-intercom/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Intercom without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Intercom changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo