Launch the client side view

Overview

We developed a Face Capture Module (FCM) to capture images that closely meet the age estimation and liveness (anti-spoofing) API requirements. FCM is available in Web and Mobile:

  • Web SDK (for React and vanilla JavaScript web application integration)

  • Mobile SDK

    • React Native SDK (for React Native mobile integration)

    • iOS SDK (for native iOS integration)

    • Android SDK (for native Android integration)

Secure Image Capture (SICAP) is enforced in Web SDK

By integrating our Web FCM, you will benefit from our proprietary Secure Image Capture (SICAP) technology. This approach effectively prevents injection attacks, as each image capture is signed and verified by our backend. It also blocks virtual cameras and HTTP request hijacking.

You can integrate the Web SDK into a mobile application using WebView, but it is still bound to the minimum browser version requirement. To support older devices, use mobile SDKs for mobile app integration.

The Face capture module makes it easy to capture a face and create an image, but it doesn't manage transactions with the age estimation API; please make these calls separately as described in the next section.


Web SDK

Our web component for the face capture module is available as a React and Vanilla JS library.

Supported Browsers

Device

Browser

Version

Android

Google Chrome

Last 3 versions

iOS

Safari

Last 3 versions

Desktop

Google Chrome

Last 4 versions


Safari

Last 4 versions


Microsoft Edge

Last 2 versions

Setup

Follow the instructions here to install and integrate the Web SDK. When starting Web FCM, you must specify the clientSdkId. Remember, the clientSdkId should be 917ceeb9-3472-451f-943b-db8d36e34b7f instead of your own SDK ID for proper routing of your request traffic to our headless AVS service endpoint. You also need to enable Multiframe.

Parameters

Parameter required

Value

Description

clientSdkId

917ceeb9-3472-451f-943b-db8d36e34b7f

Please use this value instead of your own SDK ID for proper routing of your request traffic to our headless AVS service endpoint.

secure

true

Web FCM enforces Secure Image Capture (SICAP).

encryptImage

false

Web FCM captures images in base64 format. Image encryption needs to be false to allow you to convert the image into JPEG/PNG in the next step.

multiframe

true

Multiframe mode is required to be enabled for Headless AVS.

Example code

import FaceCapture from '@getyoti/react-face-capture';

export function App() {
const onSuccess = (payload) => {
console.log('Secure Object = ', payload.secure);
console.log('base64 Image = ', payload.img);
}
const onError = (error) => console.log('Error =', error);

return <FaceCapture
clientSdkId={'917ceeb9-3472-451f-943b-db8d36e34b7f'}
secure={true}
encryptImage={false}
multiframe={true}
onSuccess={onSuccess}
onError={onError}
/>;
}
// The Face Capture does not support server side rendering.
// It needs to be loaded dynamically.

import dynamic from 'next/dynamic';
const FaceCapture = dynamic(() => import('@getyoti/react-face-capture'), {
ssr: false,
});

export default function CustomFCM() {
return <FaceCapture
clientSdkId={'917ceeb9-3472-451f-943b-db8d36e34b7f'}
secure={true}
encryptImage={false}
multiframe={true}
onSuccess={onSuccess}
onError={onError}
/>;
}
<script src="/@getyoti/react-face-capture/vanilla/index.js"></script>
<script>
const props = {
faceCaptureAssetsRootUrl: '/@getyoti/react-face-capture/vanilla/assets/face-capture/',
clientSdkId: '917ceeb9-3472-451f-943b-db8d36e34b7f',
secure: true,
encryptImage: false,
multiframe: true,
onSuccess: (data) => {
console.log('Secure Object = ', data.secure);
console.log('base64 Image = ', data.img);
},
onError: (error) => {
console.log('Error =', error);
},
};

const fcm = Yoti.FaceCaptureModule.render(props, document.getElementById('face-capture-module-root'));

function reload() {
fcm.reload();
}

The module captures the facial image automatically and provides the output in the following format:

{
"img": "<base64_img>",
"secure": {
"version": "<fcm_version>",
"token": "<session_token>",
"signature": "<result_signature>",
"verification": "<verification_data>"
}
}

It's essential to save both img and secure fields without modification for the next step.


Mobile SDK

Supported Operating Systems

Device

OS Version

Android

Android 5.0+

iOS

iOS 13.0+

Our mobile SDKs are available as iOS Native, Android Native, and React Native SDKs: