ページ/エリア: Capgo マーケティング ウェブサイト。役割: ウェブサイト コピーの文。見られる場所: component doc/SignupCta.astro, component Hero.astro。
このプラグインのセットアッププロンプトをコピーして、インストール手順とフルマークダウンガイドを取得します。
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.
インストール
インストールセクションAIアシストセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。
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.もしも手動設定を好むのであれば、以下のコマンドを実行し、下記のプラットフォーム固有の指示に従ってください:
bun add @capgo/capacitor-intercombunx cap syncインポート
「インポート」のセクションimport { CapgoIntercom } from '@capgo/capacitor-intercom';クイックスタート
「クイックスタート」のセクションIntercomを capacitor.config または loadWithKeys() 以下のAPIの前に。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'your-app-id', apiKeyIOS: 'ios-api-key', apiKeyAndroid: 'android-api-key',});await CapgoIntercom.registerIdentifiedUser({ userId: '42', email: 'user@example.com' });await CapgoIntercom.displayMessenger();例:ヘルプセンター記事
例:ヘルプセンター記事await CapgoIntercom.displayArticle({ articleId: '12345' });例:未読のアイコン
例:未読のアイコンawait CapgoIntercom.addListener('unreadCountDidChange', ({ count }) => { setBadge(count);});よくある間違い
よくある間違い- キー:呼び出し
loadWithKeys()または、他のAPIよりもIntercomのキーを設定する。 - ログアウト: call
logout()Web - Web__CAPGO_KEEP_0__の概要
セクション「APIの概要」
APIガイドIntercomをAPIキーで実行時に初期化します。 capacitor.configにキーを設定しない場合はこちらを使用してください。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
contextIntercomユーザーを登録します。 ユーザーIDまたはメールアドレスのいずれかを入力してください。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
未知のユーザーを登録未知のユーザーを登録
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
ユーザー属性を更新ログアウト
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });logout
イベントをログ未知のユーザーを登録
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
ユーザー属性を更新Intercomのカスタムイベントをログに記録します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({ name: 'example' });displayMessenger
ディスプレイメッセンジャーIntercomのメッセンジャーを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
ディスプレイメッセージコンポーザーメッセージコンポーザーを開き、メッセージを事前に埋め込みます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });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
インアプリメッセージを表示するインアプリメッセージを有効にする
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
インアプリメッセージを非表示にするIntercomのインアプリメッセージを無効にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
コンテキスト: Capgoのマーケティングウェブサイト。役割: UIラベル。表示される場所: ページエージェント/[slug].astro。メッセージキー `agents_page_copy_label` (エージェントページコピーラベル)。「表示カレンダー」セクション
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
特定のIntercomカレンダーを表示します。「表示記事」セクション
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
特定のIntercom記事を表示します。「表示アンケート」セクション
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
特定のIntercomアンケートを表示します。ID認証のためのHMACを設定します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });ユーザーJWTを設定
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
セキュアなメッセンジャー認証のためのJWTを設定します。インター コム メッセンジャー UI の下部パディングを設定
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
インター コムにプッシュ通知トークンを送信プッシュ通知を受信
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
Section titled “setUserJwt”受信したIntercomプッシュ通知を処理する。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
クリップボードにコピー現在のユーザーの未読会話の数を取得する。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);「getUnreadConversationCount」セクション
現在のユーザーの未読会話の数を取得する。IntercomLoadOptions
型の参照export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
「型の参照」セクションexport interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
「IntercomLoadOptions」セクション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パブリック API がアップストリームで変更されたときに再度同期してください。
Getting Started から続けてください
Section titled “Getting Startedから続ける”Capgoを使用している場合 Getting Started Capgoを使用してダッシュボードとAPIの操作を計画する場合、CapgoをAPIに接続します。 Using @capgo/capacitor-intercom @capgo/capacitor-intercomのネイティブ機能の使用 CapgoのAPIの概要 CapgoのAPIの概要 Capgoの導入 Capgoの導入 CapgoのAPIキー CapgoのAPIキー デバイス デバイスの実装詳細について