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

spinner

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.

1

Create a client

Every verification flow starts with a client (i.e. customer). Use the API to create the clientarrow-up-right.

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"
          }
        }'

The response will contain an id (the Client ID). It is required for the next step.

2

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": "*://*/*"
        }'
3

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>
circle-info

The links to complycube.min.js and style.css can be found in your developers portalarrow-up-right.

Next steps

Follow the full Web SDK integration guide to explore its features and customization options.