Guía del SDK web
Integra nuestros flujos web de KYC y verificación de identidad optimizados para UX con el SDK web de ComplyCube.
Resumen
Demo interactiva
Unexpected error with integration arcade: Integration is not installed on this space
Pasos de integración
1
Crear un cliente
curl -X POST https://api.complycube.com/v1/clients \\
-H 'Authorization: <YOUR_API_KEY>' \\
-H 'Content-Type: application/json' \\
-d '{
"type": "person",
"email": "john.doe@example.com",
"personDetails":{
"firstName": "John",
"lastName" :"Doe"
}
}'const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const client = await complycube.client.create({
type: "person",
email: "john.doe@example.com",
personDetails: {
firstName: "John",
lastName: "Doe"
}
});2
Generar un token de SDK
curl -X POST https://api.complycube.com/v1/tokens \\
-H 'Authorization: <YOUR_API_KEY>' \\
-H 'Content-Type: application/json' \\
-d '{
"clientId":"CLIENT_ID",
"referrer": "*://*/*"
}'const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const token = await complycube.token.generate("CLIENT_ID", {
referrer: "*://*/*"
});from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
token = cc_api.tokens.create('CLIENT_ID','*://*/*') use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$report = $ccapi->tokens()->generate('CLIENT_ID', '*://*/*');3
Montar el SDK
<!DOCTYPE html>
<html>
<head>
<!-- Importando la biblioteca JavaScript -->
<script src="complycube.min.js"></script>
<!-- Importando el CSS predeterminado -->
<link rel="stylesheet" href="style.css" />
</head>
<script>
var complycube = {};
function startVerification() {
complycube = ComplyCube.mount({
token: "<YOUR_WEB_SDK_TOKEN>",
onComplete: function(data) {
console.log("Captura completada", data)
},
});
}
</script>
<body>
<!-- Aquí es donde se montará el Web SDK -->
<div id="complycube-mount"></div>
<!-- Al hacer clic en el botón se iniciará la interfaz de verificación de ComplyCube -->
<button onClick="startVerification()">Iniciar verificación</button>
</body>
</html>

