Install the SDK

AI Tools

Once you have a working button, you can move on to installing the SDK.

To successfully integrate you will need the following information about your application from Yoti Hub:

  • SDK ID

  • Your application key pair

The Yoti SDKs are available via popular dependency management systems. Further details can be found on the pages of the specific projects.

To install the Yoti 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.0.0</version> </dependency> // If you are using Gradle, add the following dependency: compile group: 'com.yoti', name: 'yoti-sdk-api', version: ‘3.0.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”
gem install yoti # The gem provides a configuration generator for Ruby on Rails: rails generate yoti:install
// If you are using Maven, add the following dependency: <dependency> <groupId>com.yoti</groupId> <artifactId>yoti-sdk-impl</artifactId> <version>2.12.0</version> </dependency> // If you are using Gradle, add the following dependency: compile group: 'com.yoti', name: 'yoti-sdk-impl', version: ‘2.12.0'

Once you have added the Yoti SDK dependency to your project, it’s time to initialise a Yoti client as shown in the code snippet below.

const yoti = require('yoti') const CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID' const PEM_PATH = 'YOTI_KEY_FILE_PATH' const PEM_KEY = fs.readFileSync(PEM_PATH) // For SDK version < 3 const yotiClient = new yoti(CLIENT_SDK_ID, PEM) // For SDK version >= 3 const yotiClient = new yoti.Client(CLIENT_SDK_ID, PEM_KEY)
import java.io.File; import com.yoti.api.client.ActivityDetails; import com.yoti.api.client.Date; import com.yoti.api.client.FileKeyPairSource; import com.yoti.api.client.HumanProfile; import com.yoti.api.client.HumanProfile.Gender; import com.yoti.api.client.Image; import com.yoti.api.client.YotiClient; import com.yoti.api.client.YotiClientBuilder; YotiClient client = YotiClient.builder() .withClientSdkId(<YOTI_CLIENT_SDK_ID>) .withKeyPair(FileKeyPairSource.fromFile(new File("<YOTI_KEY_FILE_PATH>"))) .build();
<?php require_once './vendor/autoload.php'; $client = new \Yoti\YotiClient('YOTI_CLIENT_SDK_ID', 'YOTI_KEY_FILE_PATH');
from yoti_python_sdk import Client client = Client(YOTI_CLIENT_SDK_ID, YOTI_KEY_FILE_PATH)
const string SDK_ID = "YOTI_CLIENT_SDK_ID"; const string PEM_PATH = "YOTI_KEY_FILE_PATH"; var privateKeyStream = System.IO.File.OpenText(PEM_PATH); var yotiClient = new YotiClient(SDK_ID, privateKeyStream);
sdkID := "YOTI_CLIENT_SDK_ID"; key, _ := ioutil.ReadFile("YOTI_KEY_FILE_PATH") client, err := yoti.NewClient(sdkId, key)
Yoti.configuration do |c| c.yoti_client_sdk_id = ENV['YOTI_CLIENT_SDK_ID'] c.yoti_key_file_path = ENV['YOTI_KEY_FILE_PATH'] end # or Yoti.configuration do |c| c.yoti_client_sdk_id = ENV['YOTI_CLIENT_SDK_ID'] c.yoti_key = ENV['YOTI_KEY'] end # Where *YOTI_KEY* is an environment variable that stores the content of the secret key: # YOTI_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIEp…"
import java.io.File; import com.yoti.api.client.ActivityDetails; import com.yoti.api.client.Date; import com.yoti.api.client.FileKeyPairSource; import com.yoti.api.client.HumanProfile; import com.yoti.api.client.HumanProfile.Gender; import com.yoti.api.client.Image; import com.yoti.api.client.YotiClient; import com.yoti.api.client.YotiClientBuilder; YotiClient client = YotiClientBuilder.newInstance() .forApplication(<YOTI_CLIENT_SDK_ID>) .withKeyPair(FileKeyPairSource.fromFile(new File("<YOTI_KEY_FILE_PATH>"))) .build();
Sandbox

To see how to do this using our sandbox, please head over to the link below.

Sandbox integration


On This Page
Install the SDK