开始
复制一个设置提示,包含安装步骤和该插件的完整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.如果您更喜欢手动设置,请按照以下命令安装插件,并遵循以下平台特定的说明:
bun add @capgo/capacitor-verisoulbunx cap sync配置Verisoul
标题为“配置Verisoul”的部分Call 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 }),});重置于帐号变更
重置Call reinitialize() 当用户上下文发生变化时,例如注销后登录另一个帐号。
await Verisoul.reinitialize();安卓触摸信号
安卓触摸信号在安卓上,向您的应用程序转发触摸事件时,需要 Verisoul 触摸模式收集。
await Verisoul.recordTouchEvent({ x: 120, y: 240, action: 'down',});平台设置
平台设置继续从 Getting Started
继续从 Getting Started如果您正在使用 开始使用 来集成 Verisoul 会话,连接它与 @capgo/capacitor-Verisoul 为 API 的概述 iOS 配置 App Attest 笔记 Android 配置 Gradle 配置 使用 @capgo/capacitor-verisoul 插件教程