npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@foodello/intercom

v8.0.1

Published

Enable Intercom features for Capacitor apps

Readme

Notice 🚀

This version is for Capacitor > v8. If you are looking for plugin for another Capacitor versions use:

  • @foodello/intercom@^4.2.2 for v4
  • @foodello/intercom@^5.0.0 for v5
  • @foodello/intercom@^6.0.0 for v6
  • @foodello/intercom@^7.0.0 for v7
  • @foodello/intercom@^8.0.0 for v8

Original work based on the @capacitor-community/intercom. So, we want to thank and acknowledge all the contributors and authors of their hard work in @capacitor-community/intercom. We needed unified API with all Capacitor.js supported platforms (Android, iOS, and Web), so we decided to serve the these capabilities with this seperate Capacitor.js plugin.

This plugin is built for the Capacitor v4 upwards.

Features

  • Unified API across iOS, Android, and Web — write your Intercom integration once and run it on all three platforms with the same method calls
  • Full Intercom Messenger — display the messenger, help center, news, tickets, and all Intercom spaces
  • User authentication — identified and unidentified user login, HMAC identity verification, and JWT authentication
  • Rich content — present articles, surveys, conversations, carousels, checklists, tours, tickets, and news items
  • Push notifications — register tokens, receive and process Intercom push messages on iOS and Android
  • Event tracking — log custom events with metadata for Intercom campaigns and automation
  • User management — update user attributes, custom attributes, and company data
  • Unread conversations — listen for real-time unread count changes across all platforms
  • Messenger lifecycle events — listen for show, hide, new conversation, and email-supplied events
  • Capacitor 4, 5, 6, 7, and 8 — maintained across major Capacitor versions

Intercom SDK versions

| Platform | SDK | Version | | -------- | --- | ------- | | iOS | Intercom iOS SDK | ~> 17.0 | | Android | Intercom Android SDK | 17.x | | Web | @intercom/messenger-js-sdk | ^0.0.18 |

Platform support matrix

| Method | iOS | Android | Web | | ------ | :-: | :-----: | :-: | | load() | — | — | ✅ | | loadWithKeys() | ✅ | ✅ | — | | loginIdentifiedUser() | ✅ | ✅ | ✅ | | loginUnidentifiedUser() | ✅ | ✅ | ✅ | | logout() | ✅ | ✅ | ✅ | | updateUser() | ✅ | ✅ | ✅ | | logEvent() | ✅ | ✅ | ✅ | | present() | ✅ | ✅ | ✅ | | presentContent() | ✅ | ✅ | ✅ | | displayMessenger() | ✅ | ✅ | ✅ | | displayMessageComposer() | ✅ | ✅ | ✅ | | displayHelpCenter() | ✅ | ✅ | ✅ | | hideMessenger() | ✅ | ✅ | ✅ | | displayLauncher() | ✅ | ✅ | ✅ | | hideLauncher() | ✅ | ✅ | ✅ | | displayInAppMessages() | ✅ | ✅ | — | | hideInAppMessages() | ✅ | ✅ | — | | setUserHash() | ✅ | ✅ | ✅ | | setUserJwt() | ✅ | ✅ | ✅ | | isUserLoggedIn() | ✅ | ✅ | ✅ | | fetchLoggedInUserAttributes() | ✅ | ✅ | ✅ | | setBottomPadding() | ✅ | ✅ | ✅ | | setupUnreadConversationListener() | ✅ | ✅ | ✅ | | removeUnreadConversationListener() | — | ✅ | — | | getUnreadConversationCount() | ✅ | ✅ | ✅ | | sendPushTokenToIntercom() | — | ✅ | — | | receivePush() | — | ✅ | — | | displayArticle() | ✅ | ✅ | ✅ | | displayCarousel() | ✅ | ✅ | — |

Event listeners:

| Event | iOS | Android | Web | | ----- | :-: | :-----: | :-: | | updateUnreadCount | ✅ | ✅ | ✅ | | userEmailSupplied | — | — | ✅ | | messengerWillShow | ✅ | — | — | | messengerDidShow | ✅ | — | ✅ | | messengerWillHide | ✅ | — | — | | messengerDidHide | ✅ | — | ✅ | | newConversationStarted | ✅ | — | — | | unreadTicketCountChanged | ✅ | — | — |

Installation

npm install @foodello/intercom
npx cap sync

Usage

Importing

import { Capacitor } from '@capacitor/core';
import { Intercom } from '@foodello/intercom';

Initialization

iOS and Android initialize automatically from your Capacitor config. Web requires an explicit load() call:

if (!Capacitor.isNativePlatform()) {
  await Intercom.load({
    app_id: 'your_app_id',
    // Optional: regional data hosting
    // api_base: 'https://api-iam.eu.intercom.io',
  });
}

Runtime initialization (iOS and Android)

If you need to initialize Intercom at runtime instead of from the Capacitor config (for example, when the app ID comes from a remote config):

await Intercom.loadWithKeys({
  appId: 'your_app_id',
  iosApiKey: 'ios_sdk-xxx',       // required on iOS
  androidApiKey: 'android_sdk-xxx', // required on Android
});

User authentication

// Login with user ID, email, or both
await Intercom.loginIdentifiedUser({ userId: '12345' });
await Intercom.loginIdentifiedUser({ email: '[email protected]' });
await Intercom.loginIdentifiedUser({ userId: '12345', email: '[email protected]' });

// Login as anonymous visitor
await Intercom.loginUnidentifiedUser();

// Check login status
const { isLoggedIn } = await Intercom.isUserLoggedIn();

// Fetch current user attributes (returns userId, email, name, etc.)
const attrs = await Intercom.fetchLoggedInUserAttributes();

// Logout
await Intercom.logout();

Identity verification

If you have Messenger Security enabled, set the user hash or JWT before calling loginIdentifiedUser():

// HMAC-based identity verification
await Intercom.setUserHash({ hmac: 'your_hmac_hash' });
await Intercom.loginIdentifiedUser({ userId: '12345' });

// JWT-based identity verification
await Intercom.setUserJwt({ jwt: 'your_jwt_token' });
await Intercom.loginIdentifiedUser({ userId: '12345' });

Updating user attributes

await Intercom.updateUser({
  name: 'John Doe',
  email: '[email protected]',
  phone: '+1234567890',
  languageOverride: 'en',
  customAttributes: {
    plan: 'premium',
    signup_date: '2025-01-01',
  },
  company: {
    companyId: 'company_123',
    name: 'Acme Inc',
    plan: 'enterprise',
    monthlySpend: 499,
  },
});

Displaying the Messenger

// Open a specific space
import { IntercomSpace } from '@foodello/intercom';

await Intercom.present({ space: IntercomSpace.Home });
await Intercom.present({ space: IntercomSpace.Messages });
await Intercom.present({ space: IntercomSpace.HelpCenter });
await Intercom.present({ space: IntercomSpace.Tickets });

// Web-only spaces
await Intercom.present({ space: IntercomSpace.News });
await Intercom.present({ space: IntercomSpace.Tasks });

// Open with a pre-filled message
await Intercom.displayMessageComposer({ message: 'I need help with...' });

// Show or hide the Messenger
await Intercom.displayMessenger();
await Intercom.hideMessenger();

// Show or hide the launcher button
await Intercom.displayLauncher();
await Intercom.hideLauncher();

Presenting content

import { IntercomContent } from '@foodello/intercom';

// Articles (iOS, Android, Web)
await Intercom.presentContent({ contentType: IntercomContent.Article, contentId: '123' });

// Surveys (iOS, Android, Web)
await Intercom.presentContent({ contentType: IntercomContent.Survey, contentId: '456' });

// Conversations (iOS, Android, Web)
await Intercom.presentContent({ contentType: IntercomContent.Conversation, contentId: '789' });

// Tickets (Android, Web)
await Intercom.presentContent({ contentType: IntercomContent.Ticket, contentId: '321' });

// Carousels (iOS, Android)
await Intercom.presentContent({ contentType: IntercomContent.Carousel, contentId: '654' });

// Web-only content types
await Intercom.presentContent({ contentType: IntercomContent.Checklist, contentId: '111' });
await Intercom.presentContent({ contentType: IntercomContent.News, contentId: '222' });
await Intercom.presentContent({ contentType: IntercomContent.Tour, contentId: '333' });

Event tracking

// Simple event
await Intercom.logEvent({ name: 'completed_onboarding' });

// Event with metadata
await Intercom.logEvent({
  name: 'purchased_item',
  data: {
    item_name: 'Premium Plan',
    price: 49.99,
    currency: 'USD',
  },
});

Unread conversation count

// Set up the listener first
await Intercom.setupUnreadConversationListener();

// Listen for count changes
Intercom.addListener('updateUnreadCount', ({ unreadCount }) => {
  console.log('Unread conversations:', unreadCount);
});

// Get the current count
const { unreadCount } = await Intercom.getUnreadConversationCount();

Messenger lifecycle events

// Messenger visibility (iOS and Web)
Intercom.addListener('messengerDidShow', () => {
  console.log('Messenger is now visible');
});

Intercom.addListener('messengerDidHide', () => {
  console.log('Messenger was closed');
});

// iOS-only events
Intercom.addListener('messengerWillShow', () => {});
Intercom.addListener('messengerWillHide', () => {});
Intercom.addListener('newConversationStarted', () => {});
Intercom.addListener('unreadTicketCountChanged', () => {});

// Web-only events
Intercom.addListener('userEmailSupplied', () => {
  console.log('Visitor entered their email');
});

Push notifications (iOS and Android)

On iOS, Intercom automatically registers for push notifications when the Capacitor push notification delegate fires. On Android, you need to forward the token manually:

import { PushNotifications } from '@capacitor/push-notifications';

// Request permission and register
await PushNotifications.requestPermissions();
await PushNotifications.register();

// Forward token to Intercom (Android only)
PushNotifications.addListener('registration', async ({ value: token }) => {
  if (Capacitor.getPlatform() === 'android') {
    await Intercom.sendPushTokenToIntercom({ value: token });
  }
});

// Handle incoming Intercom push notifications (Android only)
PushNotifications.addListener('pushNotificationReceived', async (notification) => {
  if (Capacitor.getPlatform() === 'android') {
    await Intercom.receivePush(notification.data);
  }
});

Customization

// Adjust the bottom padding of the Messenger (minimum value: 20)
await Intercom.setBottomPadding({ value: '80' });

Web-specific configuration options can be passed to load():

await Intercom.load({
  app_id: 'your_app_id',
  custom_launcher_selector: '#my-intercom-button',
  alignment: 'left',          // 'left' or 'right'
  vertical_padding: 40,
  horizontal_padding: 20,
  hide_default_launcher: true, // use your own button with custom_launcher_selector
  session_duration: 300000,    // 5 minutes in ms
  action_color: '#FF5733',
  background_color: '#1A1A2E',
});

API

IntercomPlugin Interface

load(...)

load(config: IntercomWebConfig) => Promise<void>

Load Intercom and set configs on Web environment.

Only available for Web

| Param | Type | | ------------ | --------------------------------------------------------------- | | config | IntercomWebConfig |

Since: 4.2.0


loadWithKeys(...)

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

Load Intercom and set configs on Web environment.

Only available for iOS and Android

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | LoadWithKeysOption |

Since: 4.2.0


registerIdentifiedUser(...)

registerIdentifiedUser(options: { userId?: string; email?: string; }) => Promise<void>

| Param | Type | | ------------- | ------------------------------------------------- | | options | { userId?: string; email?: string; } |

Since: 1.0.0


loginIdentifiedUser(...)

loginIdentifiedUser(options: { userId?: string; email?: string; }) => Promise<void>

Login an identified user with Intercom.

| Param | Type | | ------------- | ------------------------------------------------- | | options | { userId?: string; email?: string; } |

Since: 4.1.0


registerUnidentifiedUser()

registerUnidentifiedUser() => Promise<void>

Since: 1.0.0


loginUnidentifiedUser()

loginUnidentifiedUser() => Promise<void>

Login an unidentified user with Intercom.

Since: 4.1.0


updateUser(...)

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

Updates a user's attributes in Intercom.

| Param | Type | | ------------- | ------------------------------------------------------------------------------- | | options | IntercomUserUpdateOptions |

Since: 1.0.0


logout()

logout() => Promise<void>

Logs the user out of Intercom.

Since: 1.0.0


logEvent(...)

logEvent(options: { name: string; data?: any; }) => Promise<void>

Logs an event with optional metadata in Intercom.

| Param | Type | | ------------- | ------------------------------------------ | | options | { name: string; data?: any; } |

Since: 1.0.0


displayMessenger()

displayMessenger() => Promise<void>

Since: 1.0.0


displayMessageComposer(...)

displayMessageComposer(options: { message: string; }) => Promise<void>

Displays the Intercom Message Composer with an initial message.

| Param | Type | | ------------- | --------------------------------- | | options | { message: string; } |

Since: 1.0.0


displayHelpCenter()

displayHelpCenter() => Promise<void>

Since: 1.0.0


hideMessenger()

hideMessenger() => Promise<void>

Hides the Intercom Messenger.

Since: 1.0.0


displayLauncher()

displayLauncher() => Promise<void>

Displays the default Intercom Launcher.

Since: 1.0.0


hideLauncher()

hideLauncher() => Promise<void>

Hides the Intercom Launcher.

Since: 1.0.0


displayInAppMessages()

displayInAppMessages() => Promise<void>

Displays Intercom In-App Messages.

Since: 1.0.0


hideInAppMessages()

hideInAppMessages() => Promise<void>

Hides Intercom In-App Messages.

Since: 1.0.0


displayCarousel(...)

displayCarousel(options: { carouselId: string; }) => Promise<void>

| Param | Type | | ------------- | ------------------------------------ | | options | { carouselId: string; } |

Since: 1.0.0


setUserHash(...)

setUserHash(options: { hmac: string; }) => Promise<void>

Sets the HMAC user hash for Intercom Identity Verification.

| Param | Type | | ------------- | ------------------------------ | | options | { hmac: string; } |

Since: 1.0.0


setUserJwt(...)

setUserJwt(options: { jwt: string; }) => Promise<void>

Sets a JSON Web Token (JWT) for user authentication in the Messenger. Must be called before loginIdentifiedUser() or loginUnidentifiedUser().

| Param | Type | | ------------- | ----------------------------- | | options | { jwt: string; } |

Since: 8.0.0


isUserLoggedIn()

isUserLoggedIn() => Promise<{ isLoggedIn: boolean; }>

Returns whether a user is currently logged in to Intercom.

Returns: Promise<{ isLoggedIn: boolean; }>

Since: 8.0.0


fetchLoggedInUserAttributes()

fetchLoggedInUserAttributes() => Promise<IntercomUserAttributes | Record<string, string> | undefined>

Fetches the attributes of the currently logged-in Intercom user.

Returns: Promise<IntercomUserAttributes | Record<string, string>>

Since: 8.0.0


setBottomPadding(...)

setBottomPadding(options: { value: string; }) => Promise<void>

Sets the bottom padding for the Intercom Messenger.

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Since: 1.0.0


sendPushTokenToIntercom(...)

sendPushTokenToIntercom(options: { value: string; }) => Promise<void>

Sends a push token to Intercom.

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Since: 1.0.0


receivePush(...)

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

Processes a received Intercom push notification.

| Param | Type | | ------------------ | ------------------------------------------------------------------------------------- | | notification | IntercomPushNotificationData |

Since: 1.0.0


displayArticle(...)

displayArticle(options: { articleId: string; }) => Promise<void>

| Param | Type | | ------------- | ----------------------------------- | | options | { articleId: string; } |

Since: 1.0.0


presentContent(...)

presentContent(options: { contentType: IntercomContent; contentId: string; }) => Promise<void>

Presents an Intercom content item by its type and ID.

| Param | Type | | ------------- | ------------------------------------------------------------------------------------------------ | | options | { contentType: IntercomContent; contentId: string; } |

Since: 4.1.0


present(...)

present(options: { space: IntercomSpace; }) => Promise<void>

Presents the Intercom's space.

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | { space: IntercomSpace; } |

Since: 4.1.0


setupUnreadConversationListener()

setupUnreadConversationListener() => Promise<void>

Setup listener for unread conversation count updates.

Since: 4.1.0


removeUnreadConversationListener()

removeUnreadConversationListener() => Promise<void>

Remove listener for unread conversation count updates.

Since: 4.1.0


getUnreadConversationCount()

getUnreadConversationCount() => Promise<{ unreadCount: number; }>

Get current unread conversation count.

Returns: Promise<{ unreadCount: number; }>

Since: 4.1.0


addListener('updateUnreadCount', ...)

addListener(eventName: 'updateUnreadCount', listenerFunc: (data: { unreadCount: number; }) => void) => Promise<PluginListenerHandle>

Listen for when the unread conversation count is changed.

| Param | Type | | ------------------ | -------------------------------------------------------- | | eventName | 'updateUnreadCount' | | listenerFunc | (data: { unreadCount: number; }) => void |

Returns: Promise<PluginListenerHandle>

Since: 4.1.0


addListener('userEmailSupplied', ...)

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

Listen for when a visitor enters their email into the Messenger.

Only available for Web

| Param | Type | | ------------------ | -------------------------------- | | eventName | 'userEmailSupplied' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('messengerWillShow', ...)

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

Listen for when the Messenger is about to be shown.

Only available for iOS

| Param | Type | | ------------------ | -------------------------------- | | eventName | 'messengerWillShow' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('messengerDidShow', ...)

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

Listen for when the Messenger is shown.

Only available for iOS and Web

| Param | Type | | ------------------ | ------------------------------- | | eventName | 'messengerDidShow' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('messengerWillHide', ...)

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

Listen for when the Messenger is about to be hidden.

Only available for iOS

| Param | Type | | ------------------ | -------------------------------- | | eventName | 'messengerWillHide' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('messengerDidHide', ...)

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

Listen for when the Messenger is hidden.

Only available for iOS and Web

| Param | Type | | ------------------ | ------------------------------- | | eventName | 'messengerDidHide' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('newConversationStarted', ...)

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

Listen for when new conversation is started.

Only available for iOS

| Param | Type | | ------------------ | ------------------------------------- | | eventName | 'newConversationStarted' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


addListener('unreadTicketCountChanged', ...)

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

Listen for when unread ticket count changes.

Only available for iOS

| Param | Type | | ------------------ | --------------------------------------- | | eventName | 'unreadTicketCountChanged' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>

Since: 7.0.0


Interfaces

IntercomWebConfig

IntercomWebConfig Interface

Represent configs that are available on Intercom Web SDK.

| Prop | Type | Description | Default | Since | | ------------------------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- | | app_id | string | Configure Intercom Web APP ID. The APP ID of your Intercom app which will indicate where to store any data. Only available for Web | | 4.2.0 | | api_base | IntercomRegionalApiBase | Configure Intercom's regional API baseurl. For customers who are using Regional Data Hosting for Intercom, there is an additional parameter to set, to ensure your Messenger is pointing to your Regional workspace. Only available for Web | | 4.2.0 | | custom_launcher_selector | string | Configure Intercom custom launcher selector. The CSS selector of an element to trigger Intercom("show") in order to activate the messenger. To target an element by ID: "#id_of_element". To target elements by class ".classname_of_elements" Only available for Web | | 4.2.0 | | alignment | IntercomAlignment | Configure Intercom default launcher alignment. Dictate the alignment of the default launcher icon to be on the left/right. Possible values: "left" or "right" (any other value is treated as right). Only available for Web | "right" | 4.2.0 | | vertical_padding | number | Configure Intercom default launcher icon's vertical padding. Move the default launcher icon vertically. Padding from bottom of screen. Minimum value: 20. Does not work on mobile. Only available for Web | | 4.2.0 | | horizontal_padding | number | Configure Intercom default launcher icon's horizontal padding. Move the default launcher icon horizontally. Padding from right side of screen Minimum value: 20. Does not work on mobile. Only available for Web | | 4.2.0 | | hide_default_launcher | boolean | Configure Intercom default launcher icon's visibility. Hide the default launcher icon. Setting to false will forcefully show the launcher icon. Only available for Web | | 4.2.0 | | session_duration | number | Configure Intercom session duration. Time in milliseconds for the Intercom session to be considered active. A value of 5 * 60 * 1000 would set the expiry time to be 5 minutes Only available for Web | | 4.2.0 | | action_color | string | Configure action color for Intercom. Used in button links and more to highlight and emphasise. The color string can be any valid CSS Color Name HEX or RGB Only available for Web | | 4.2.0 | | background_color | string | Configure background color for Intercom. Used behind your team profile and other attributes. The color string can be any valid CSS Color Name HEX or RGB Only available for Web | | 4.2.0 |

LoadWithKeysOption

LoadWithKeysOption Interface.

Represents options required for dynamic load of native Intercom SDK.

Only available for iOS and Android.

| Prop | Type | Description | | ------------------- | ------------------- | -------------------- | | appId | string | | | iosApiKey | string | Required for iOS | | androidApiKey | string | Required for Android |

IntercomUserUpdateOptions

IntercomUserUpdateOptions Interface

Represents the options for updating a user's attributes in Intercom.

Only available for iOS and Android.

| Prop | Type | | ---------------------- | ------------------------------------------------------------ | | userId | string | | email | string | | name | string | | phone | string | | languageOverride | string | | customAttributes | Record<string, any> | | company | CompanyOption | | companies | CompanyOption[] |

CompanyOption

CompanyOption Interface.

Represents Intercom option to include company details.

| Prop | Type | Description | | ---------------------- | ------------------------------------------------------------ | ----------------------------- | | name | string | Required for Web | | companyId | string | Required for Native platforms | | createdAt | number | Unix timestamp | | monthlySpend | number | | | plan | string | | | customAttributes | Record<string, any> | |

IntercomUserAttributes

IntercomUserAttributes Interface

Attributes returned by fetchLoggedInUserAttributes().

Only available for iOS and Android.

| Prop | Type | | ---------------------- | ------------------------------------------------------------ | | userId | string | | email | string | | name | string | | phone | string | | languageOverride | string | | customAttributes | Record<string, any> |

IntercomPushNotificationData

IntercomPushNotificationData Interface

Represents the structure of a received Intercom push notification.

Only available for iOS and Android.

| Prop | Type | | ------------------------------- | ------------------- | | conversation_id | string | | message | string | | body | string | | author_name | string | | image_url | string | | app_name | string | | receiver | string | | conversation_part_type | string | | intercom_push_type | string | | uri | string | | push_only_conversation_id | string | | instance_id | string | | title | string | | priority | number |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

Type Aliases

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

Enums

IntercomRegionalApiBase

| Members | Value | | -------- | --------------------------------------------- | | Us | 'https://api-iam.intercom.io' | | Eu | 'https://api-iam.eu.intercom.io' | | Au | 'https://api-iam.au.intercom.io' |

IntercomAlignment

| Members | Value | | ----------- | -------------------- | | Left | 'left' | | Right | 'right' |

IntercomContent

| Members | Value | Description | Since | | ------------------ | --------------------------- | ---------------------------------- | ----- | | Article | 'article' | | | | Survey | 'survey' | | | | Carousel | 'carousel' | Only available for iOS and Android | 4.1.0 | | Checklist | 'checklist' | Only available for Web | 4.2.0 | | News | 'news' | Only available for Web | 4.2.0 | | Tour | 'tour' | Only available for Web | 4.2.0 | | Ticket | 'ticket' | | 7.0.0 | | Conversation | 'conversation' | | 7.0.0 |

IntercomSpace

| Members | Value | Description | Since | | ---------------- | ----------------------- | ---------------------- | ----- | | Home | 'home' | | | | Messages | 'messages' | | | | HelpCenter | 'help' | | | | News | 'news' | Only available on web. | 4.2.0 | | Tasks | 'tasks' | Only available on web. | 4.2.0 | | Tickets | 'tickets' | | 7.0.0 |

Platform configuration

iOS

Add your Intercom credentials to capacitor.config.ts (or capacitor.config.json):

{
  "plugins": {
    "Intercom": {
      "iosApiKey": "ios_sdk-xxx",
      "iosAppId": "yyy"
    }
  }
}

Then run:

npx cap sync ios
npx cap open ios

Sign your app in Xcode under the General tab.

Tip: After changing native code, clean the build cache (Product > Clean Build Folder) before running again.

Android

Add your Intercom credentials to capacitor.config.ts (or capacitor.config.json):

{
  "plugins": {
    "Intercom": {
      "androidApiKey": "android_sdk-xxx",
      "androidAppId": "yyy"
    }
  }
}

Then run:

npx cap sync android
npx cap open android

Tip: After changing native code, clean the build cache (Build > Clean Project) before running again.

Web

No native configuration needed. Call Intercom.load() with your app_id in your application code. See the Usage section above.

License

MIT

Original repository's maintainers and sponsors

This repository is based on the wonderful work of the official @capacitor-community/intercom -plugin. Here we want to acknowledge the mastermind and sponsors behind that work.

Sponsors

Maintainers

| Maintainer | GitHub | Social | | ------------ | --------------------------------------- | ----------------------------------------- | | Stewan Silva | stewones | @stewones |

Future plans

If you have any ideas what we should include, please open a new issue for it.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!