兼容 Cube 节点.js 库
与ComplyCube API整合的官方Node.js库.
装入立方体 使您能够将您的 AML/ KYC 工作流程自动化 .
文件可在下列地点找到: https://docs.complycube.com (中文(中国大陆) )。 。 。 .
安装
使用 npm :
npm install @complycube/api
使用 Yarn :
yarn add @complycube/api
开始
需要软件包 :
const { ComplyCube } = require("@complycube/api");
配置您的 API 密钥 :
const complycube = new ComplyCube({
apiKey: process.env.COMPLYCUBE_API_KEY
});
使用方式 async编号 :await (单位:千美元) async function:
try {
const client = await complycube.client.create({
type: "person",
email: "[email protected]",
personDetails: {
firstName: "Jane",
lastName: "Doe"
}
});
const check = await complycube.check.create(client.id, {
type: "standard_screening_check"
});
return check;
} catch (error) {
if (error instanceof ComplyCubeApiError) {
// An error response was returned by the ComplyCube API.
console.log(error.message);
console.log(error.type);
} else {
console.log(error.message);
}
}
承诺:
complycube.client
.create({
type: "person",
email: "[email protected]",
personDetails: {
firstName: "Jane",
lastName: "Doe"
}
})
.then(client =>
complycube.check.create(client.id, {
type: "standard_screening_check"
})
)
.then(check =>
// Handle successfully created check.
)
.catch(error => {
// Handle error.
});
答复格式
所有响应都将是JavaScript对象.
const client = await complycube.client.create({
type: "person",
email: "[email protected]",
personDetails: {
firstName: "Jane",
lastName: "Doe"
}
});
console.log(client);
{
"id": "<CLIENT_ID>",
"type": "person",
"email": "[email protected]",
"personDetails": {
"firstName": "Jane",
"lastName": "Doe"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
更多文档
更多文档和代码示例可见于 https://docs.complycube.com (中文(中国大陆) )。 。 。 .
有关ComplyCube的更多信息,请访问 https://www.complycube.com (中文(中国大陆) )。 。 。 .