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.
インストール
「インストール」のセクション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.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください:
bun add @capgo/capacitor-crispbunx cap syncインポート
セクション「インポート」import { CapacitorCrisp } from '@capgo/capacitor-crisp';APIの概要
セクション「APIの概要」configure
「設定」を選択Configure the Crisp SDK with your website ID. Must be called before using any other methods.
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
「トークンIDを設定」を選択ユーザーセッションのユニークなトークンIDを設定します。 前回の会話を識別して復元するために使用されます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CapacitorCrisp.setTokenID({} as { tokenID: string });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
Section titled “setInt”カスタム整数データフィールドを設定します。 ユーザーセッションに関連付けられた数値データを保存します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setInt({ key: 'user_level', value: 42 });setString
Section titled “setString”カスタム文字列データフィールドを設定します。 ユーザーセッションに関連付けられたテキストデータを保存します。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setString({ key: 'subscription_tier', value: 'premium' });sendMessage
sendMessageユーザーからチャットにメッセージを送信します。 プログラムでメッセージを送信します。ユーザーが入力したように見えます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.sendMessage({ value: 'Hello, I need help!' });setSegment
setSegmentユーザーをターゲットと組織化するためにセグメントを設定します。 Criss ダッシュボードでユーザーをカテゴリ化するために使用されます。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CrispPlugin.setSegment({ segment: 'premium-users' });reset
resetCrisp セッションをリセットします。 ユーザー データをすべてクリアし、新しいセッションを開始します。 ユーザーがログアウトしたときに便利です。
import { CapacitorCrisp } from '@capgo/capacitor-crisp';
await CapacitorCrisp.reset();Type Reference
Type ReferenceConfigureOptions
ConfigureOptions__CAPGO_KEEP_0__の初期化用の設定です。
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
イベントカラーCrispイベント用の可用色。イベントをCrispダッシュボードで視覚的に区別するために使用されます。
export type eventColor = | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown' | 'grey' | 'black';真実の源
真実の源このページはプラグインの src/definitions.tsAPIがアップストリームで変更された場合に、パブリックを再実行してください。
Getting Startedから続けてください
Getting Startedから続けてください__CAPGO_KEEP_0__がアップストリームで変更された場合に、パブリックを再実行してください。 はじめに APIとAPIの計画ダッシュボードとAPIの操作に接続する @capgo/capacitor-crispを使用する @capgo/capacitor-crispのnative機能のために APIの概要 APIの実装詳細のために 導入 導入の実装詳細のために APIのキー APIのキーとデバイスの実装詳細のために デバイス デバイスの実装詳細のために