Web SDK Guide
Leverage our UX-optimised Web SDK to quickly verify your clients.
Overview
The ComplyCube Web SDK is a lightweight JavaScript library that lets you embed identity verification and KYC flows directly into your web applications. It provides a ready-made, user-friendly widget for capturing documents, selfies, and proof of address, while handling quality detection and fraud signals under the hood.
Interactive demo
Integration steps
The Web SDK can be integrated in two ways: through workflows for complete verification journeys, or with check-driven integration for fine-grained control.
The steps below demonstrate how to add the Web SDK to your web application.
Create a client
Every verification flow starts with a client (i.e. customer). Use the API to create the client.
Example request
curl -X POST https://api.complycube.com/v1/clients \
-H 'Authorization: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"type": "person",
"email": "[email protected]",
"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: "[email protected]",
personDetails: {
firstName: "John",
lastName: "Doe"
}
});The response will contain an id (the Client ID). It is required for the next step.
Generate an SDK Token
Tokens enable clients to send personal data to ComplyCube via our SDKs securely. Use the generate token endpoint to obtain an SDK token and initialize the Web SDK next.
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', '*://*/*');Mount the SDK
To mount our Web SDK, you need to include it on your target page, as shown below.
<!DOCTYPE html>
<html>
<head>
<!-- Importing the Javascript library -->
<script src="complycube.min.js"></script>
<!-- Importing the default CSS -->
<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 complete", data)
},
});
}
</script>
<body>
<!-- This is where the Web SDK will be mounted -->
<div id="complycube-mount"></div>
<!-- Clicking the button will start the ComplyCube verification UI -->
<button onClick="startVerification()">Start verification</button>
</body>
</html>
Next steps
Follow the full Web SDK integration guide to explore its features and customization options.

