スタートガイド
インストール手順と、このプラグインの完全なMarkdownガイドを含むセットアッププロンプトをコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-verisoul`
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/verisoul/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 のスキルを追加してください:
bunx 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-verisoul` plugin in my project.手動セットアップを希望する場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム別の手順に従ってください:
bun add @capgo/capacitor-verisoulbunx cap syncクイックスタート
「クイックスタート」セクションimport { Verisoul } from '@capgo/capacitor-verisoul';
await Verisoul.configure({ environment: 'dev', projectId: 'project-id-123',});例: getSessionId
「例: getSessionId」というタイトルのセクションimport { Verisoul } from '@capgo/capacitor-verisoul';
const result = await Verisoul.getSessionId();console.log(result);例: 再初期化
「例:再初期化」セクションimport { Verisoul } from '@capgo/capacitor-verisoul';
await Verisoul.reinitialize();よくある落とし穴
「よくある落とし穴」セクション- 一度だけ初期化: アプリの起動時にセットアップを実行します。
- ネイティブ同期: 実行
bunx cap syncプラグインのアップグレード後。 - 信頼できる情報源: 信頼
src/definitions.tsGitHub リポジトリ内。
Verisoulの設定
「Verisoulの設定」セクション呼び出す configure() アプリの起動時に一度だけ実行します。テストには sandbox を使用し、 prod は本番環境のトラフィックに使用してください。
import { Verisoul } from '@capgo/capacitor-verisoul';
await Verisoul.configure({ environment: 'prod', projectId: 'YOUR_PROJECT_ID',});セッションIDの取得
「セッションIDの取得」セクションVerisoulが十分なネイティブシグナルを収集した後、セッションIDをリクエストしてバックエンドに送信します。リスク評価を行うため、バックエンドからVerisoulのサーバーサイド API を呼び出す必要があります。
const { sessionId } = await Verisoul.getSessionId();
await fetch('/api/risk/verisoul', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionId }),});アカウント変更時にリセット
「アカウント変更時のリセット」セクション呼び出す reinitialize() ログアウト後に別のアカウントでログインするなど、ユーザーのコンテキストが変更された場合。
await Verisoul.reinitialize();Androidのタッチシグナル
「Android touch signals」セクションAndroidでVerisoulのタッチパターン収集が必要な場合は、タッチイベントをフォワードしてください。
await Verisoul.recordTouchEvent({ x: 120, y: 240, action: 'down',});プラットフォームのセットアップ
「プラットフォームのセットアップ」セクション- iOSの設定 App Attestのentitlementに関する注意点について説明しています。
- Androidの設定 Verisoul Mavenリポジトリと権限の設定について説明します。
Getting Startedの続きを進める
「Getting Started からの続き」セクション使用している場合 スタートガイド Verisoulセッションを統合するには、以下と連携してください: @capgo/capacitor-verisoul API の概要についてはこちら、 iOSの設定 App Attestに関する注意事項についてはこちら、 Androidの設定 Gradleの設定についてはこちら、および @capgo/capacitor-verisoulを使用する プラグインのチュートリアル用です。