SDK guide
Once you've set up a verified organisation account on the Yoti Hub, you’re ready to start integrating with the Age estimation and Anti-spoofing API.
Face Capture
For optimal face capture, Yoti provides the Face Capture Module (FCM), which is designed to capture optimal images meeting the requirements of the API. This is available as a Native .Net package.
Capture your images by using our Face Capture Module (FCM).
Integration
Install the SDK
To simply the integration process, Yoti provides SDKs to integrate with our API. These are available via popular dependency management systems.
npm install -S -E yoti
Once you have added the Yoti SDK dependency to your project, you can use it to build and send your request. See the code snippets below for examples.
const PATHS = {
AGE: "/age-verify",
AGE_LIVENESS: "/age-antispoofing-verify",
};
const data = {
img: "base64img",
threshold: 25,
operator: "OVER",
metadata: {
"device": "mobile"
}
};
const request = new RequestBuilder()
.withBaseUrl('https://api.yoti.com/ai/v1')
.withPemFilePath('<YOTI_KEY_FILE_PATH>')
.withEndpoint(PATHS.AGE_LIVENESS)
.withPayload(new Payload(data))
.withMethod('POST')
.withHeader('X-Yoti-Auth-Id', '<YOTI_CLIENT_SDK_ID>')
.build();
const response = request.execute();
Retrieve Results
The endpoint will return the Anti-spoofing result alongside Age threshold check.
{
"age": {
"age_check": "pass"
},
"antispoofing": {
"prediction": "real"
}
}