@alloyidentity/web-sdk

中文文档
2.16.0发布于 2026/10/06MITTypeScriptESM + CJS近 30 天下载 8.1万

Alloy Web Document SDK

原始使用文档
文档目录7 节
  1. Installation
  2. Documentation
  3. Local Testing
  4. Install dependencies
  5. Init Params
  6. Environment and API targets
  7. Run the SDK in a browser

🔐 Alloy SDK

Alloy helps top banks and fintechs make better decisions using a single API and dashboard to manage KYC/AML, fraud, and more.

Installation

For npm users:

npm install @alloyidentity/web-sdk

For pnpm users:

pnpm add @alloyidentity/web-sdk

For yarn users:

yarn add @alloyidentity/web-sdk

Documentation

https://developer.alloy.com/public/docs/document-verification-web-sdk

Local Testing

Follow the steps below to run the SDK locally!

Install dependencies

From the repository root:

npm install

Init Params

Edit the example/src/App.jsx file with the appropriate init params:

const alloyInitParams = {
  key: '<your-sdk-key>',
  journeyToken: '<your-journey-token>',
  journeyApplicationToken: '<your-journey-application-token>',
};

Environment and API targets

By default the SDK points to Alloy's hosted endpoints (see src/config.ts):

  • SDK UI (iframe): https://alloysdk.alloy.co/
  • API: https://docv-prod-api.alloy.co/

Override these in alloy.init() when testing against a specific Alloy environment:

const alloyInitParams = {
  key: '<your-sdk-key>',
  journeyToken: '<your-journey-token>',
  journeyApplicationToken: '<your-journey-application-token>',
  apiUrl: 'https://corekube-dev-alloysdk.api.alloy.com/',
  appUrl: 'https://corekube-dev-alloysdk.app.alloy.com/',
};

Run the SDK in a browser

The example/ app is a small React app that loads the local SDK build via "alloy": "file:..".

To run the example app from the repository root:

npm run build
cd example
npm install
npm start

Open http://localhost:3000

版本与发布记录

@alloyidentity/web-sdk 共发布 129 个版本,首次发布于 2020/04/05;过去 12 个月发布了 38 个版本。

版本发布日期距今
2.16.0latest2026/10/061 个月前
2.16.0-beta.0beta2026/10/051 个月前
2.15.02026/09/281 个月前
2.15.0-beta.02026/09/261 个月前
2.14.02026/09/231 个月前
2.13.02026/09/171 个月前

其他发布通道:next → 2.3.0-1,beta → 2.16.0-beta.0。

关于 @alloyidentity/web-sdk 的常见问题

@alloyidentity/web-sdk 是什么?

Alloy Web Document SDK

如何安装 @alloyidentity/web-sdk?

在项目目录运行 npm install @alloyidentity/web-sdk,或使用 pnpm add / yarn add / bun add。

@alloyidentity/web-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@alloyidentity/web-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@alloyidentity/web-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@alloyidentity/web-sdk 可以商用吗?

@alloyidentity/web-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@alloyidentity/web-sdk 的下载量有多少?

根据 npm 官方下载统计,@alloyidentity/web-sdk 在 2026/10/06 – 2026/11/04 这 30 天内被下载 81,297 次,日均约 2,710 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@alloyidentity/web-sdk 还在维护吗?

最新版本 2.16.0 发布于 2026/10/06(1 个月前);至今共发布 129 个版本,其中过去 12 个月发布了 38 个;首次发布于 2020/04/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。