Title
Create new category
Edit page index title
Edit category
Edit link
Quick start
Here is a quick start guide to accelerate your SDK integration. For detailed information, we suggest that you read through the step-by-step integration guide.
Install the SDK
Yoti SDKs are available for several languages through popular dependency management systems.
To install the SDK:
xxxxxxxxxxnpm install -S -E yotiUsing Yoti SDKs
The description on how to use the above endpoint from the SDK can be found here:
Please read the above for a full description and understanding, below we have provided examples on how those requests will expose the new functionality.
First, specify the required imports and create a DocScanClient using the SDK ID and the PEM file. Then, define the subject to be returned in the verification report. And set the advanced identity profile requirements to your desired scheme. You will need to set up the SDK configuration and a session specification using the scheme requirements and the SDK config. Finally, use the DocScanClient to create a session by providing the session specification. Retrieve the Session ID and Client Session Token and utilise them to generate the iframe URL.
xxxxxxxxxxconst path = require('path');const fs = require('fs'); const { IDVClient, SessionSpecificationBuilder, SdkConfigBuilder,} = require('yoti'); const YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID';const YOTI_PEM = fs.readFileSync(path.join(__dirname, '/path/to/pem'));const idvClient = new IDVClient(YOTI_CLIENT_SDK_ID, YOTI_PEM); const subject = { subject_id: 'subject_id_string',}; const advancedIdentityProfileScheme = new AdvancedIdentityProfileSchemeBuilder() .withType('DBS') .withObjective('STANDARD') .withLabel('DBS-EXAMPLE') .build(); const advancedIdentityProfile = new AdvancedIdentityProfileBuilder() .withTrustFramework('UK_TFIDA') .withScheme(advancedIdentityProfileScheme) .build(); const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder() .withProfile(advancedIdentityProfile) .build(); const sdkConfig = new SdkConfigBuilder() .withAllowHandoff(true) .withSuccessUrl(`${APP_BASE_URL}/success`) .withErrorUrl(`${APP_BASE_URL}/error`) .build(); const sessionSpec = new SessionSpecificationBuilder() .withSubject(subject) .withAdvancedIdentityProfileRequirements(advancedIdentityProfileRequirements) .withSdkConfig(sdkConfig) .build(); const session = await idvClient.createSession(sessionSpec); const sessionId = session.getSessionId();const clientSessionToken = session.getClientSessionToken(); const iframeURL = `${config.YOTI_DOC_SCAN_IFRAME_URL}? sessionID=${sessionId}&sessionToken=${clientSessionToken}`;Subject Explained
| Field | Value | Description | Mandatory |
|---|---|---|---|
| subject | Object | Allows to provide information on the subject. | Optional |
| subject_id | String | Allows to track the same user across multiple sessions. Should not contain any personal identifiable information. | Optional |
Identity Profile Requirements Explained
| Trust framework | Scheme | Objective | Description |
|---|---|---|---|
| UK_TFIDA | RTW | N/A | UK certified right to work verification. |
| UK_TFIDA | RTR | N/A | UK certified right to rent verification. |
| UK_TFIDA | DBS | BASIC, STANDARD, ENHANCED | UK certified digital method for verifying a person's identity for criminal record checks |
| YOTI_GLOBAL | IDENTITY | AL_L1, AL_M1 | Yoti created Identity verification that can be set to a low assurance "L1" or a medium assurance "M1". The medium assurance adds a biometric face match. |
| YOTI_GLOBAL | IDENTITY_PLUS_ADDRESS | AL_L1, AL_M1 | Yoti created Identity verification that can be set to a low assurance "L1" or a medium assurance "M1". The medium assurance adds a biometric face match. An address check will also be performed. |
| YOTI_GLOBAL | GBR_RTW_SHARECODE | N/A | Yoti created verification that will fetch a users share code details and compare them to details extracted from a users Id documents. |
| YOTI_GLOBAL | CAN_CRC | N/A | Yoti created Identity verification that will verify a document and perform a biometric face match. For the Canadian Criminal Record Check. |
Client side view
Once you have generated the iframe URL, you can send it to the frontend for it to be rendered on the page. Please see example below:
<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Embedded IDV Integration</title></head> <body> <div> <iframe style="border:none;" width="100%" height="750" allow="camera" src="<%= iframeUrl %>" allowfullscreen></iframe> </div></body> </html>Retrieve Results
After a session has been created, you can use the Yoti SDK to retrieve the session result (containing all the end-user's uploaded documents and associated metadata).
Result of the session
Session retrieval requires a session ID. This is generated while creating a session as demonstrated above.
xxxxxxxxxx// Returns the session resultconst sessionResult = await idvClient.getSession(sessionId); // Returns the session stateconst state = sessionResult.getState(); // Returns session resourcesconst resources = session.getResources();Retrieve Media
In order to retrieve document images and document fields from the resources container we have to look for the relevant media ID inside of the id document pages.
xxxxxxxxxx// Returns a collection of ID Documentsconst idDocuments = resources.getIdDocuments(); const media = await idvClient.getMediaContent(sessionId, mediaId); const buffer = media.getContent();const base64Content = media.getBase64Content();const mimeType = media.getMimeType();Retrieve Identity Profile
Once the session has reached the state of 'Completed', identify profile can be successfully retrieved.
In case of a successful transaction, once the identity profile is received, the identity profile report JSON will be accessible. This contains the media ID which can then be used to get the full JSON response of the report.
xxxxxxxxxxconst advancedIdentityProfile = sessionResult.getAdvancedIdentityProfile();const report = advancedIdentityProfile.getIdentityProfileReport(); const mediaID = report.getMedia().getId();const identityProfileReportMedia = await idvClient.getMediaContent(sessionId, mediaId); const identityProfileReportMediaBuffer = identityProfileReportMedia.getContent();Got a question? Contact us here.