Guide du SDK Web
Intégrez nos parcours KYC et de vérification d’identité basés sur le web et optimisés pour l’UX avec le SDK Web ComplyCube.
Vue d'ensemble
Démo interactive
Unexpected error with integration arcade: Integration is not installed on this space
Étapes d'intégration
1
Créer un client
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
Générez un jeton 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
Intégrer le SDK
<!DOCTYPE html>
<html>
<head>
<!-- Importation de la bibliothèque JavaScript -->
<script src="complycube.min.js"></script>
<!-- Importation du CSS par défaut -->
<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("Capture terminée", data)
},
});
}
</script>
<body>
<!-- C’est ici que le Web SDK sera intégré -->
<div id="complycube-mount"></div>
<!-- En cliquant sur le bouton, vous lancerez l’interface de vérification ComplyCube -->
<button onClick="startVerification()">Démarrer la vérification</button>
</body>
</html>

