Workflow Integration
Use workflows to integrate the Android SDK.
Overview
This guide walks you through integrating the React Native SDK with ComplyCube workflows.

Integration flow
The Mobile SDK runs on your mobile application, but relies on your backend to create secure tokens. Here’s how it works:

Integration guide
Explore the source code and sample projects on our repository: .
Install the SDK
Install the React Native library by running:
Complete the steps in the iOS and Android tabs.
Sentry integration
If you’re integrating Sentry into your React Native project, you might encounter the following compiler error:
This issue occurs due to a version incompatibility between the Sentry React Native package and the native Sentry SDK.
To resolve this error (as of @sentry/react-native v5.31.0 and iOS Sentry v8.36.0), update the import statements in your code.
In SentrySdkInfo.h and SentryInternalSerializable.h, replace:
Before using the ComplyCube SDK, install the CocoaPods plugin by running the following command in your terminal:
Add plugin repos and install the pod using your
Podfile:
Application permissions
Our SDK uses the device camera and microphone for capture. You must add the following keys to your application Info.plist file.
NSCameraUsageDescription
NSMicrophoneUsageDescription
Our SDK requires the repositories below.
repositories {
mavenCentral(),
maven { url 'https://maven.fpregistry.io/releases' }
}
dependencies {
implementation "com.complycube:complycube-sdk:+"
}Create a client
Every verification flow starts with a client (i.e. customer). Use the API to create the client.
This must be done on your mobile app backend server, not the mobile app itself.
Example request
Example response
The response will contain an id (the Client ID). It is required for the next step.
Generate an SDK token
Your backend must create an SDK token for each new flow. This token enable customers to send personal data securely from your mobile app to ComplyCube.
Tokens are short-lived and must not be reused.
Example request
curl -X POST https://api.complycube.com/v1/tokens \
-H 'Authorization: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"clientId":"CLIENT_ID",
"appId": "com.complycube.SampleApp"
}'const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const token = await complycube.token.generate("CLIENT_ID", {
appId: "com.complycube.SampleApp"
});from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
token = cc_api.tokens.create('CLIENT_ID', appId='com.complycube.SampleApp')use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$token = $ccapi->tokens()->generate('CLIENT_ID', 'com.complycube.SampleApp');Example response
{
"token": "<CLIENT_TOKEN>"
}Initialize the SDK
As part of initializing the SDK, you are required to specify a workflow template ID. The SDK will automatically run the active version of the selected workflow.
Perform checks
Once your customer starts the flow, a workflow session is automatically created. This session contains all captured data (documents, images, and videos) as well as progress tracking. You can view all of them through the workflow sessions page on the portal or through the API.
When the flow finishes, the SDK triggers the onSuccess callback. The callback provides a data object that includes the workflowSessionId. Your mobile backend should use this ID to notify ComplyCube that the workflow has completed, which in turn runs the verification checks defined in the workflow.
If you have set up webhooks as described in our webhooks guide, you will be notified once a workflow session completes.
Example of a complete workflow session request
curl -X POST https://api.complycube.com/v1/workflowSessions/{:wfSessionId}/complete \
-H 'Authorization: <YOUR_API_KEY>' \
-H 'Content-Type: application/json'const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const wfSession = await complycube.workflowSession.complete("WORKFLOW_SESSION_ID");from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
workflow_session = cc_api.workflowsessions.complete('WORKFLOW_SESSION_ID')use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$workflowSession = $ccapi->workflowSessions()->complete('WORKFLOW_SESSION_ID');using ComplyCube.Net;
using ComplyCube.Net.Resources.WorkflowSessions;
var wfSessionApi = new WorkflowSessionApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var workflowSession = await wfSessionApi.CompleteAsync("WORKFLOW_SESSION_ID");Retrieve verification results
Your mobile backend can retrieve the workflow session details and associated check results using our API.
All our checks are asynchronous. If you have set up webhooks as described in our webhooks guide, you will be notified once a check completes.
You can retrieve the details of a workflow session by calling the retrieve workflow session request.
To retrieve the check results, you can perform a get check request.
Example of a workflow session retrieval request
curl -X GET https://api.complycube.com/v1/workflowSessions/{:workflowSessionId} \
-H 'Authorization: <YOUR_API_KEY>' const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const wfSession = await complycube.workflowSession.get("WORKFLOW_SESSION_ID");from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
workflow_session = cc_api.workflowsessions.get('WORKFLOW_SESSION_ID')use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$workflowSession = $ccapi->workflowSessions()->get('WORKFLOW_SESSION_ID');using ComplyCube.Net;
using ComplyCube.Net.Resources.WorkflowSessions;
var wfSessionApi = new WorkflowSessionApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var workflowSession = await wfSessionApi.GetAsync("WORKFLOW_SESSION_ID");Example of a check retrieval request
curl -X GET https://api.complycube.com/v1/checks/{:checkId} \
-H 'Authorization: <YOUR_API_KEY>' const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const check = await complycube.check.get("CHECK_ID");from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
check = cc_api.checks.get('CHECK_ID')use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$check = $ccapi->checks()->get('CHECK_ID');using ComplyCube.Net;
using ComplyCube.Net.Resources.Checks;
var checkApi = new CheckApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var check = await checkApi.GetAsync("CHECK_ID");NFC capture
The ComplyCube mobile SDK supports NFC-based RFID chip reading for identity documents equipped with embedded chips. This allows for secure data extraction and high-assurance document authentication.
Pre-requisites
Install the CocoaPods Artifactory plugin by running the following command in your terminal:
To add the library, copy your repository credentials into a
.netrcfile to your home directory and setup the repository:Remember to fetch your credentials from JFrog using the Set Me Up button here.
Add plugin repos and install the pod using your
Podfile:You must add the following keys to your application
Info.plistfile:
To read NFC tags correctly, you need to add the following entries to your app target's
Info.plistfile:
Start by adding your access credentials for the ComplyCube NFC-Enabled SDK repository to the
gradle.propertiesfile of your mobile app:
Then, update your project level
build.gradlefile with the ComplyCube SDK repository Maven settings:
Update your module level
build.gradlefile with the SDK dependency:
Branding
The SDK allows you to customize the UI to match your application’s visual identity. You can define primary and accent colors during configuration to align the verification flow with your brand guidelines. Learn more about our appearance properties (see below).
Localization
The SDK supports the languages listed below.
Arabic -
ar🇦🇪Chinese (Simplified) -
zh🇨🇳Chinese (Traditional) -
hk🇨🇳Dutch -
nl🇳🇱English -
en🇺🇸French -
fr🇫🇷German -
de🇩🇪Hindi -
hi🇮🇳Indonesian -
id🇮🇩Italian -
it🇮🇹
Japanese -
ja🇯🇵Korean -
ko🇰🇷Norwegian -
no🇳🇴Polish -
po🇵🇱Portuguese -
pt🇵🇹Spanish -
es🇪🇸Swedish -
sv🇸🇪Thai -
th🇹🇭Vietnamese -
vi🇻🇳
Result handling
To manage the outcome of a verification session, you must implement the success, cancelled, and error callbacks.
On a successful completion (onSuccess), you can trigger check requests from your backend using the resource IDs returned in the result object. These IDs correspond to the uploaded assets (e.g. documents, selfies) and can be used to initiate verification checks via the ComplyCube API.
If the user exits the flow before completion, the onCancelled callback is invoked with a descriptive reason indicating why the session was cancelled (e.g. user exit, timeout, permission denied)
If the SDK encounters an issue, the onError callback is triggered with a ComplyCubeError object containing the error type and message. Refer to the error codes (see below), for a full list of possible error cases.
Events tracking
The SDK tracks a range of events throughout the verification flow, covering all key user interactions across stages. See below for the list of events.
If you need to implement custom analytics, you can hook into these events and trigger your own tracking logic accordingly.
To incorporate your own tracking, define a function and apply it using the eventHandler property in your settings:
Token expiry handling
To handle token expiration gracefully, you can provide a callback function that generates a new SDK token when needed. This allows the flow to continue seamlessly without requiring the user to restart the session manually.

