# React Native Module

The React Native Module initialization much depends on the mode your dashboard operates on. Use the documention below only if your dashbord is still in Flows/Levels mode, otherwise please refer to the main documentation.

# Backend routines

In order to embed our MobileSDK you have to complete a couple of preparation steps on your backend and use the results to pass into the MobileSDK initialization:

# Step 1: Applicant Flow

Set up your applicant flow or pick a predefined one (e.g. msdk-basic-kyc) in the dashboard

# Step 2: Access Token

Generate an access token that is associated with the externalUserId - a user id in your system. This is needed for constraining the access token to only one applicant.

For testing purposes make sure to use App token and Secret key pair that was created on Sandbox for request authorization headers.

curl -X POST \
  'https://api.sumsub.com/resources/accessTokens?userId=SomeUserIdInYourSystem&ttlInSecs=600' \
    -H 'Accept: application/json'

# Step 3: All done!

Now you can initialize the Mobile SDK.

# Setup

# Regular Flow

import SNSMobileSDK from '@sumsub/react-native-mobilesdk-module';

// ...

let launchSNSMobileSDK = () => {

    let apiUrl = "https://api.sumsub.com" // use the same for both the production and the sandbox
    let flowName = "msdk-basic-kyc" // or set up your own with the dashboard
    let accessToken = "your_access_token" // generate one on the backend

    let snsMobileSDK = SNSMobileSDK.Builder(apiUrl, flowName)
      .withAccessToken(accessToken, () => {
        // this is a token expiration handler, will be called if the provided token is invalid or got expired
        // call your backend to fetch a new access token (this is just an example)
        return fetch('http://example.org/', {
          method: 'GET',
        }).then(resp => {
          // return a fresh token from here
          return 'new_access_token'
      .withHandlers({ // Optional callbacks you can use to get notified of the corresponding events
        onStatusChanged: (event) => {
          console.log("onStatusChanged: [" + event.prevStatus + "] => [" + event.newStatus + "]");
        onLog: (event) => {
          console.log("onLog: [Idensic] " + event.message);
      .withSupportEmail('[email protected]')
      .withLocale('en') // Optional, for cases when you need to override system locale

    snsMobileSDK.launch().then(result => {
      console.log("SumSub SDK State: " + JSON.stringify(result))
    }).catch(err => {
      console.log("SumSub SDK Error: " + JSON.stringify(err))

The snsMobileSDK.launch() returns a Promise that will be resolved with a Result object. Use it to determine the SDK status upon its closure.

Here is an example of the result:

  "success": false,
  "status": "Failed",
  "errorType": "Unauthorized",
  "errorMsg": "Unauthorized access with accessToken=[your access token]"

Please find a detailed description in the main documentation.

# Action Flow

In order to run the SDK in applicant action mode, you need to create an applicant flow of Applicant actions type in the dashboard and specify its name as the flowName initialization parameter. Also, it'll be required to make an Access Token not only with the userId parameter, but with the externalActionId one as well.

Aside from the notes above, you manage the sdk the same way that you do with regular flows, the only difference is in how you get the action's result (please see the main documentation for further details).

Last Updated: 12/30/2021, 10:37:46 AM