开始使用
复制一个包含安装步骤和此插件的完整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辅助设置来安装插件。将Capgo技能添加到您的AI工具中,使用以下命令:
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-verisoul` plugin in my project.如果您更喜欢手动设置,请运行以下命令并按照以下平台特定的说明进行操作:
npm install @capgo/capacitor-verisoulnpx cap sync配置Verisoul
标题:配置VerisoulCall configure() once, early in your app startup. Use sandbox for testing and prod for production traffic.
import { Verisoul } from '@capgo/capacitor-verisoul';
await Verisoul.configure({ environment: 'prod', projectId: 'YOUR_PROJECT_ID',});Get a session ID
Section titled “Get a session ID”After Verisoul has collected enough native signals, request the session ID and send it to your backend. Your backend should call Verisoul’s server-side API for the risk assessment.
const { sessionId } = await Verisoul.getSessionId();
await fetch('/api/risk/verisoul', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionId }),});Reset on account changes
Section titled “Reset on account changes”Call reinitialize() 当用户上下文发生变化,例如注销后重新登录另一个账户。
await Verisoul.reinitialize();Android触摸信号
标题:Android触摸信号在Android上,向您的应用程序转发触摸事件以收集Verisoul触摸模式。
await Verisoul.recordTouchEvent({ x: 120, y: 240, action: 'down',});平台设置
标题:平台设置继续从开始使用
标题:继续从开始使用如果您正在使用 开始使用 将Verisoul会话与 @capgo/capacitor-verisoul 了解API的概述 iOS设置 App Attest说明 Android设置 Gradle设置 使用@capgo/capacitor-verisoul 为插件教程。