Langsung ke konten

Getting Started

Konten ini belum tersedia dalam bahasa Anda.

  1. Install the package

    Terminal window
    npm i @capgo/capacitor-intercom
  2. Sync with native projects

    Terminal window
    npx cap sync
  3. Add keys in capacitor.config.ts (optional) You can configure Intercom at startup time with this section:

    {
    "plugins": {
    "CapgoIntercom": {
    "iosApiKey": "ios_sdk-xxx",
    "iosAppId": "your_ios_app_id",
    "androidApiKey": "android_sdk-xxx",
    "androidAppId": "your_android_app_id"
    }
    }
    }

Use loadWithKeys() to provide credentials at runtime:

import { CapgoIntercom } from '@capgo/capacitor-intercom'
await CapgoIntercom.loadWithKeys({
appId: 'your_app_id',
apiKeyIOS: 'ios_sdk-xxx',
apiKeyAndroid: 'android_sdk-xxx',
})

Open the messenger and show support UI in one line:

import { CapgoIntercom } from '@capgo/capacitor-intercom'
await CapgoIntercom.displayMessenger()
await CapgoIntercom.displayHelpCenter()
await CapgoIntercom.registerIdentifiedUser({ email: 'user@example.com' })
await CapgoIntercom.displayArticle({ articleId: 'article-id' })
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id' })
await CapgoIntercom.displayMessageComposer({ message: 'Hi, I need help' })
await CapgoIntercom.registerUnidentifiedUser()
await CapgoIntercom.hideMessenger()
const { count } = await CapgoIntercom.getUnreadConversationCount()
  • iOS: Requires iOS 10+.
  • Android: Supports Android 5.0+ (API 21+).
  • Works with both Capacitor and Cordova environments for native apps.

You now have a functional Intercom setup and can start adding event logging, identity sync, and support messaging.