Create a session

There are four steps to follow to integrate the Identity verification SDK:

  1. Install the SDK
  2. Create the session
  3. Launch the user view
  4. Retrieve the results

This section will explain how to install the SDK and create a session.

Before you start
You will need the Yoti App on your phone and to have registered your business with Yoti. Click here for more info.

Installing the SDK

Please use our Yoti SDKs to automatically build the relevant session. You will need the following information about your application from the Yoti Hub:

  • Yoti SDK ID
  • Your application key pair

The Yoti SDKs are available via popular dependency management systems.

Node.js
Java
PHP
C#
Go
Copy

Create a session

Once you have added the Yoti SDK dependency to your project, you can use it to build and create your session as shown in the code snippet below:

Node.js
Java
PHP
C#
Go
Copy

Your session can be configured with the following:

  • Preferences
  • Scheme
  • Notifications
Recommendation
Yoti strongly recommends you to use notifications for each session status.

Client Preferences

To create a session, please start by setting your preferences. For this purpose, the method sdkConfig builder is explained below. If parameters are not defined the default below will be set:

Node.js
Java
PHP
C#
Go
Copy
TypeParameter (examples)Description
withPrimaryColour#2d9fff(default), #ff0000Colours of the button provided in the frontend client as a hexadecimal RGB value.
withPresetIssuingCountryUSA, GBR

The user must select the issuing country of the document they are uploading. This setting determines which issuing country is selected by default.

NOTE: Must be a 3 letter ISO 3166 code.

withSuccessUrlhttps://yourdomain.com/successIf the upload/photo is successfully captured redirect your users here. Yoti will then begin to carry out the requested checks and tasks. If undefined, the page will not redirect and you can listen to Yoti's post messages on the same page.
withErrorUrlhttps://yourdomain.com/errorIf the upload/photo is unsuccessfully captured redirect your users here. If undefined, the user view will display an error screen, with the error code as a query parameter and won't redirect. (Details on the error codes can be found in [Client side user view](Client side user view))
withAllowHandofftrue, falseif enabled will offer the user to transfer flow from desktop to a mobile device by scanning a QR code.

Session Requirements

After that, specify the desired scheme in the identity profile requirements.

Node.js
Java
PHP
C#
Go
Copy

Identity Profile Requirements Explained

FieldValueDescriptionMandatory
trust_frameworkStringDefines under which trust framework this identity profile should be verified. Enum: YOTI_GLOBALYes
schemeObjectDefines which scheme this identity profile should satisfy. The scheme must be supported by the specified trust framework otherwise the request is considered invalid.Yes
typeStringDefines which scheme this identity profile should satisfy. Enum: "IDENTITY", "IDENTITY_PLUS_ADDRESS"Yes
objectiveStringDefines the objective to be achieved for the particular scheme. It must be provided for those schemes where it is mandatory. Example, this is mandatory for DBS and the possible values are: ”AL_L1”, “AL_M1”.Yes (in case of DBS)
labelStringDefines a label given to a specific scheme, allowing integrators to identify the results of a specific scheme.Yes

System Preferences

Then, specify the subject id and set the system preferences for your session.

Node.js
Java
PHP
C#
Go
Copy

The table below explains the optional parameters for the session and data retention configuration.

ParametersDescriptionOptional
withClientSessionTokenTtlThis is how long the full Identity verification session is open for in seconds. This must be longer than 300s (5 minutes).
withResourcesTtl

Retention period ("time to live") for uploaded documents/images in number of seconds. Default is one week (60_60_24*7=604800). This can be a minimum of 24 hours and must be at least 24 hours longer than the client_session_token_ttl. It starts from the first media upload.

Note: This config may result in additional charges. Please get in touch with support if considering a TTL longer than three months.

withUserTrackingIdAllows the relying business backend to track the same user across multiple sessions. Note: This should not contain any personal identifiable information.
WithSubjectAllows to track the same user across multiple sessions. Should not contain any personal identifiable information.

Document Filter

If you wish to exclude documents or only allow specific documents to be used, you can do this by adding a document filter to your configuration.

Node.js
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard