跳过内容

Getting Started

GitHub

安装

安装

您可以使用我们的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.

如果您prefer手动设置,请运行以下命令并按照以下平台特定的说明进行安装:

终端窗口
npm install @capgo/capacitor-verisoul
npx cap sync

配置Verisoul

配置Verisoul

在应用启动时调用一次。使用 configure() 用于测试和 sandbox 用于生产流量。 prod 复制到剪贴板

import { Verisoul } from '@capgo/capacitor-verisoul';
await Verisoul.configure({
environment: 'prod',
projectId: 'YOUR_PROJECT_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 }),
});

标题:重置在帐号变化时

调用

protectedTokens reinitialize() 当用户上下文发生变化时,例如注销后登录另一个帐户。

await Verisoul.reinitialize();

Android触摸信号

Android触摸信号部分

在Android上,向您的应用程序转发触摸事件以收集Verisoul触摸模式。

await Verisoul.recordTouchEvent({
x: 120,
y: 240,
action: 'down',
});

平台设置

平台设置部分

继续从 Getting Started

标题:继续从 Getting Started

如果您正在使用 Getting Started 将 Verisoul 会话与 @capgo/capacitor-verisoul 查看API的概述 iOS 配置 查看 App Attest 的说明 Android 配置 查看 Gradle 配置 使用 @capgo/capacitor-verisoul {"targetLanguage":"Simplified Chinese","protectedTokens":["Cloudflare","Capacitor","GitHub","Capgo","code","API","SDK","CLI","npm","bun"],"texts":["","","","","","","","","",""],"result":["","","","","","","","","",""]}"]