Getting Started
このプラグインのインストールステップとフルマークダウンガイドのセットアッププロンプトをコピーする
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-crisp`
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/crisp/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.
__CAPGO_KEEP_1__
__CAPGO_KEEP_2__AI-Assisted セットアップを使用してプラグインをインストールできます。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-crisp` plugin in my project.手動セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-crispbunx cap syncインポート
「インポート」のセクションimport { CapacitorCrisp } from '@capgo/capacitor-crisp';API の概要
「API の概要」のセクションconfigure
「設定」SDK をウェブサイト ID で設定する。 他のメソッドを使用する前に呼び出す必要があります。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.configure({ websiteID: 'YOUR_WEBSITE_ID' });openMessenger
「メッセンジャーを開く」Crisp メッセンジャー チャット ウィンドウを開く。 ユーザーにチャット インターフェイスを表示します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CapacitorCrisp.openMessenger();setTokenID
Section titled “setTokenID”セッション用のユニークなトークンIDを設定します。 前回の会話を識別して復元するために使用されます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CapacitorCrisp.setTokenID({} as { tokenID: string });setUser
Section titled “setUser”現在のセッションのユーザー情報を設定します。 サポートエージェントが見るユーザープロファイルを更新します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setUser({ nickname: 'John Doe', email: 'john@example.com', phone: '+1234567890'});pushEvent
Section titled “pushEvent”Crispにカスタムイベントをプッシュします。 ユーザーの行動や行動を追跡するために使用されます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.pushEvent({ name: 'completed_purchase', color: 'green'});setCompany
Section titled “setCompany”現在のセッションの会社情報を設定します。 ユーザーをCrispの会社に関連付けます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setCompany({ name: 'Acme Corp', url: 'https://acme.com', employment: ['CEO', 'Executive'], geolocation: ['USA', 'San Francisco']});setInt
setIntユーザー セッションに関連付けられた数値データを保存するカスタム整数データ フィールドを設定します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setInt({ key: 'user_level', value: 42 });setString
setStringユーザー セッションに関連付けられたテキスト データを保存するカスタム文字列データ フィールドを設定します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setString({ key: 'subscription_tier', value: 'premium' });sendMessage
setSendMessageユーザーがメッセージをタイプしたように、プログラムでメッセージを送信します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.sendMessage({ value: 'Hello, I need help!' });setSegment
setSegmentユーザーをターゲットと組織化するために使用される、ユーザー セグメントを設定します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setSegment({ segment: 'premium-users' });セッションをリセットします。 ユーザーデータをすべて削除し、新しいセッションを開始します。 ログアウトしたときに便利です。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CapacitorCrisp.reset();タイプ リファレンス
Section titled “Type Reference”ConfigureOptions
Section titled “ConfigureOptions”Crispの初期化に使用する設定です。
export interface ConfigureOptions { /** * Your Crisp website ID from dashboard. */ websiteID: string; /** * Optional - Locale to force in the Crisp chat widget (ISO 639-1), eg. `en`, `fr`, `es`. * Web + Android: overrides the runtime locale. iOS follows the device/app locale. */ locale?: string; /** * Optional - Unique token identifier for the user session continuity. */ tokenID?: string;}eventColor
Section titled “eventColor”Crispイベントの可視化に使用する色です。
export type eventColor = | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown' | 'grey' | 'black';ソース オブ トゥルース
真実の源このページはプラグインから生成されています。 src/definitions.ts. 公開 API がアップストリームで変更された場合、再度同期を実行してください。
Getting Started から続けてください
Getting Started から続けてくださいCapacitor を使用している場合 Getting Started を使用してダッシュボードと __CAPGO_KEEP_0__ の操作を計画する場合、Capacitor を接続してください。 Capacitor の @API/__CAPGO_KEEP_1__-crisp を使用 Capacitor の @capgo/capacitor-crisp のネイティブ機能について for the native capability in Using @capgo/capacitor-crisp, API の実装詳細について for the implementation detail in API Overview, Introduction Introductionの実装詳細について API Keys API Keysの実装詳細について、 Devices Devicesの実装詳細について