Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intercom`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/intercom/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」のセクションYou can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示に従ってください:
bun add @capgo/capacitor-intercombunx cap syncインポート
「インポート」セクションimport { CapgoIntercom } from '@capgo/capacitor-intercom';APIの概要
「APIの概要」セクションloadWithKeys
「loadWithKeys」セクション実行時に API キーを使用して Intercom を初期化します。 capacitor.config にキーコンフィグを設定しない場合はこちらを使用します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);registerIdentifiedUser
「registerIdentifiedUser」セクション既知のユーザーを Intercom に登録します。 ユーザー ID またはメールアドレスのいずれかを入力する必要があります。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
「registerUnidentifiedUser」セクション匿名ユーザーを Intercom に登録します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
「updateUser」セクションIntercom にユーザー属性を更新します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);logout
「logout」セクションユーザーをIntercomからログアウトします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
logEventのセクションIntercomでカスタムイベントをログします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
displayMessengerのセクションIntercomのメッセンジャーを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
displayMessageComposerのセクションメッセージコンポーザーを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
displayHelpCenterのセクションIntercom ヘルプセンターを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
「メッセンジャーハイド」セクションIntercom メッセンジャーを非表示にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
「ローカーナビゲーターディスプレイ」セクションIntercom ローカーナビゲーターを表示します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
「ローカーナビゲーター非表示」セクションIntercom ローカーナビゲーターを非表示にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
「インアプリメッセージディスプレイ」セクション__CAPGO_KEEP_0__を使用してインアプリメッセージをIntercomから有効にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
__CAPGO_KEEP_2__セクション(hideInAppMessages)Intercomからインアプリメッセージを無効にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
__CAPGO_KEEP_4__セクション(displayCarousel)特定のIntercomカーレルを表示します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
__CAPGO_KEEP_6__セクション(displayArticle)特定のIntercom記事を表示します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
__CAPGO_KEEP_8__セクション(displaySurvey)特定のIntercomサーベイを表示します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
ユーザーハッシュを設定するユーザーIDのハッシュ値を設定します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
ユーザーJWTを設定するセキュアなメッセンジャー認証用のJWTを設定します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
ボトムパディングを設定するIntercomメッセンジャーUIの下部パディングを設定します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
プッシュトークンをIntercomに送信する__CAPGO_KEEP_0__をIntercomに送信します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
受信プッシュ__CAPGO_KEEP_2__を受信した場合の処理
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
受信未読会話数__CAPGO_KEEP_0__の未読会話数を取得
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();型リファレンス
型リファレンスIntercomLoadOptions
IntercomLoadOptionsexport interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
「IntercomIdentifiedUserOptions」セクションexport interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
「IntercomUserUpdateOptions」セクションexport interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
「IntercomLogEventOptions」セクションexport interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
「IntercomMessageComposerOptions」セクションexport interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
「IntercomCarouselOptions」セクションexport interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
「IntercomArticleOptions」セクションexport interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
IntercomSurveyOptionsセクションexport interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
IntercomUserHashOptionsセクションexport interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
IntercomUserJwtOptionsセクションexport interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
IntercomBottomPaddingOptionsセクションexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
IntercomPushTokenOptionsセクションexport interface IntercomPushTokenOptions { value: string;}このページはプラグインから生成されています。 src/definitions.ts. upstreamのpublic APIが変更された場合に再度syncを実行してください。
Getting Startedから続けてください。
Getting Startedから続けてください。Capacitorを使用している場合 Getting Started Capacitorを使用してダッシュボードとAPIの操作を計画する場合、Capacitorを Capacitorを使用してnative capabilityを実装する場合、@capgo/capacitor-intercom for the native capability in Using @capgo/capacitor-intercom, Capacitorの実装詳細についてはAPI Overview for the implementation detail in API Overview, Capacitorの概要 導入の実装詳細について API キー API キーについての実装詳細、 デバイス デバイスの実装詳細について。