Quick start

We suggest you read through the step by step integration guide to understand the integration in detail. Please see below for example code snippets and examples projects.

Before you start
You will need to access your Yoti Hub account with an e-mail & password or using the Yoti mobile app and to have registered your business with Yoti. Click below for more info.

Example code

Below is an example complete request snippet in different languages.

Install the SDK

npm install -S -E yoti
// If you are using Maven, add the following dependency:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-api</artifactId>
<version>3.8.0</version>
</dependency>

// If you are using Gradle, add the following dependency:
implementation group: 'com.yoti', name: 'yoti-sdk-api', version: '3.8.0'
// Get the Yoti PHP SDK library via a Composer package
composer require yoti/yoti-php-sdk
pip install yoti
// To install the Yoti NuGet package you will need to install NuGet.
// To import the latest Yoti SDK into your project, enter the following
// command from NuGet Package Manager Console in Visual Studio:

Install-Package Yoti

// For other installation methods, see https://www.nuget.org/packages/Yoti
// As of version 2.4.0, modules are used. This means it's not necessary to get a copy or fetch all dependencies
// as instructed below, as the Go toolchain will fetch them as necessary.
// You can simply add a `require github.com/getyoti/yoti-go-sdk/v3` to go.mod.
// To download and install the Yoti SDK and its dependencies, run the following command from your terminal:

go get "github.com/getyoti/yoti-go-sdk/v3"

Basic session

This is a basic example showing:

  • One document authenticity check

  • Text extraction

  • Liveness

  • Face match.

const path = require('path');
const fs = require('fs');

const {
IDVClient,
SessionSpecificationBuilder,
RequestedDocumentAuthenticityCheckBuilder,
RequestedLivenessCheckBuilder,
RequestedTextExtractionTaskBuilder,
RequestedFaceMatchCheckBuilder,
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);

//Document Authenticity Check
const documentAuthenticityCheck = new RequestedDocumentAuthenticityCheckBuilder().build();

//Liveness check with 3 retries
const livenessCheck = new RequestedLivenessCheckBuilder()
.forStaticLiveness()
import com.yoti.api.client.ClassPathKeySource;
import com.yoti.api.client.docs.DocScanClient;
import com.yoti.api.client.docs.DocScanException;
import com.yoti.api.client.docs.session.create.CreateSessionResult;
import com.yoti.api.client.docs.session.create.SdkConfig;
import com.yoti.api.client.docs.session.create.SessionSpec;
import com.yoti.api.client.docs.session.create.check.RequestedDocumentAuthenticityCheck;
import com.yoti.api.client.docs.session.create.check.RequestedFaceMatchCheck;
import com.yoti.api.client.docs.session.create.check.RequestedLivenessCheck;
import com.yoti.api.client.docs.session.create.task.RequestedIdDocTextExtractionTask;

...
DocScanClient docScanClient = DocScanClient.builder()
.withClientSdkId("YOTI_CLIENT_SDK_ID")
.withKeyPairSource(ClassPathKeySource.fromClasspath("/path/to/pem"))
<?php

require_once './vendor/autoload.php';

use Yoti\DocScan\DocScanClient;
use Yoti\DocScan\Session\Create\Check\RequestedDocumentAuthenticityCheckBuilder;
use Yoti\DocScan\Session\Create\Check\RequestedFaceMatchCheckBuilder;
use Yoti\DocScan\Session\Create\Check\RequestedLivenessCheckBuilder;
use Yoti\DocScan\Session\Create\SdkConfigBuilder;
use Yoti\DocScan\Session\Create\SessionSpecificationBuilder;
use Yoti\DocScan\Session\Create\Task\RequestedTextExtractionTaskBuilder;
use Yoti\DocScan\Session\Create\NotificationConfigBuilder;

$YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID';
$YOTI_PEM = '/path/to/pem';

$client = new DocScanClient($YOTI_CLIENT_SDK_ID, $YOTI_PEM);

$sessionSpec = (new SessionSpecificationBuilder())
->withClientSessionTokenTtl(600)
from yoti_python_sdk.doc_scan import (
DocScanClient,
RequestedDocumentAuthenticityCheckBuilder,
RequestedFaceMatchCheckBuilder,
RequestedLivenessCheckBuilder,
RequestedTextExtractionTaskBuilder,
SdkConfigBuilder,
SessionSpecBuilder,
NotificationConfigBuilder
)

YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID'
YOTI_PEM = '/path/to/pem'

doc_scan_client = DocScanClient(YOTI_CLIENT_SDK_ID, YOTI_PEM)

sdk_config = (
SdkConfigBuilder()
.with_primary_colour("#2d9fff")
.with_preset_issuing_country("GBR")
.with_success_url("/your/success/url")
.with_error_url("/your/error/url")
.build()
)

notification_config = (
NotificationConfigBuilder()
.with_endpoint('https://yourdomain.example/idverify/updates')
using System.IO;
using System.Net.Http;
using Yoti.Auth;
using Yoti.Auth.DocScan;
using Yoti.Auth.DocScan.Session.Create;
using Yoti.Auth.DocScan.Session.Create.Check;
using Yoti.Auth.DocScan.Session.Create.Task;

...
const string YOTI_CLIENT_SDK_ID = "YOTI_CLIENT_SDK_ID";
const string PEM_PATH = "/path/to/pem";

StreamReader privateKeyStream = System.IO.File.OpenText(PEM_PATH);
var key = CryptoEngine.LoadRsaKey(privateKeyStream);

var docScanClient = new DocScanClient(YOTI_CLIENT_SDK_ID, key, new HttpClient());

var sessionSpec = new SessionSpecificationBuilder()
.WithClientSessionTokenTtl(600)
.WithResourcesTtl(90000)
.WithUserTrackingId("some-user-tracking-id")
.WithRequestedCheck(
package main

import (
"io/ioutil"

"github.com/getyoti/yoti-go-sdk/v3/docscan"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/check"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/filter"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/objective"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/task"
)

var (
sdkId string
key []byte
client *docscan.Client
createSessionResult *create.SessionResult
)

func main() {
sdkId := "YOTI_CLIENT_SDK_ID"
key, _ := ioutil.ReadFile("/path/to/pem")

client, err := docscan.NewClient(sdkId, key)
{
"client_session_token_ttl": 900,
"resources_ttl": 90000,
"user_tracking_id": "some-user-tracking-id",
"block_biometric_consent": false,
"requested_checks": [
{
"type": "ID_DOCUMENT_AUTHENTICITY",
"config": {
"manual_check": "ALWAYS"
}
},
{
"type": "LIVENESS",
"config": {
"liveness_type": "STATIC",
"max_retries": 3
}
},
{
"type": "ID_DOCUMENT_FACE_MATCH",
"config": {
"manual_check": "FALLBACK"
}
}
],
"requested_tasks": [

Advanced session

This is an advanced example showing:

  • One document authenticity check

  • Text extraction

  • Liveness

  • Face match

  • Supporting document

  • Proof of address

  • Document filters.

const path = require('path');
const fs = require('fs');

const {
DocScanClient,
SessionSpecificationBuilder,
RequestedDocumentAuthenticityCheckBuilder,
RequestedLivenessCheckBuilder,
RequestedTextExtractionTaskBuilder,
RequestedFaceMatchCheckBuilder,
SdkConfigBuilder,
NotificationConfigBuilder,
ProofOfAddressObjectiveBuilder,
RequiredSupplementaryDocumentBuilder,
RequiredIdDocumentBuilder,
OrthogonalRestrictionsFilterBuilder

} = 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 filter = new OrthogonalRestrictionsFilterBuilder()
// Allow from specific countries
import com.yoti.api.client.ClassPathKeySource;
import com.yoti.api.client.docs.DocScanClient;
import com.yoti.api.client.docs.DocScanException;
import com.yoti.api.client.docs.session.create.CreateSessionResult;
import com.yoti.api.client.docs.session.create.NotificationConfig;
import com.yoti.api.client.docs.session.create.SdkConfig;
import com.yoti.api.client.docs.session.create.SessionSpec;
import com.yoti.api.client.docs.session.create.check.RequestedDocumentAuthenticityCheck;
import com.yoti.api.client.docs.session.create.check.RequestedFaceMatchCheck;
import com.yoti.api.client.docs.session.create.check.RequestedLivenessCheck;
import com.yoti.api.client.docs.session.create.check.RequestedIdDocumentComparisonCheck;
import com.yoti.api.client.docs.session.create.task.RequestedIdDocTextExtractionTask;
// Coming soon
# Coming soon
// Coming soon
// Coming soon
{
"client_session_token_ttl": 900,
"resources_ttl": 90000,
"user_tracking_id": "some-user-tracking-id",
"block_biometric_consent": false,
"notifications": {
"endpoint": "https://yourdomain.example/idverify/updates",
"topics": [
"SESSION_COMPLETION"
],
"auth_token": "some_auth_token",
"auth_type": "BASIC"
},
"requested_checks": [
{
"type": "ID_DOCUMENT_AUTHENTICITY",
"config": {
"manual_check": "FALLBACK"
}
},
{
"type": "LIVENESS",
"config": {
"liveness_type": "STATIC",
"max_retries": 3

Web examples

If we don't support your language please get in touch with us.