FaceAuthenticator
Importing SDK
To use Sdk, you can either remotely import the .js
file or download it locally.
Remotely
Include the .js
file directly from the CDN:
You can retrieve the class from the SDK using the following code:
Initialization
initializeSdk(token: string, sdkContainer: string, useFaceAuthenticator: boolean, personId: string, options: any)
initializeSdk(token: string, sdkContainer: string, useFaceAuthenticator: boolean, personId: string, options: any)
The SDK has an isolated initialization method, to allow greater control over when it occurs.
During this process, the SDK will initialize its internal variables and download the resources it needs to run.
[!]You must call this method before using other SDK methods.
Supported Parameters
Example
Filter
Filter configuration for camera preview. It can be classic
, shaded
(additional detail, the default), vibrant
(full color), clear
(no filter) and blur
(starts blurred).
Language
Through the language
parameter, the application language can be changed, the default value is pt_BR
, check the availability below:
Iframe
To perform integration through an iframe, camera and fullscreen permissions must be provided.
Webview
To use the SDK through a Webview, camera permission must be granted in your native application.
Example implementation on Android.
AndroidManifest.xml
MainActivity
Sample android project for webview implementation, in addition it is necessary to be able to open the application in full screen, the example shows how to configure it correctly.
Opening and taking selfies
execute()
execute()
The method used to load the SDK onto the screen and perform selfie capture.
It will initialize the video stream (requesting permissions if needed) and load it into the container.
Example
Return
Example
Signed response params
The isAlive parameter is VERY IMPORTANT, based on it validation must be carried out to continue with the flow or not, in the case of isAlive: true
your user can continue with the journey, in the case of isAlive: false
, this user is not valid and should be barred from the rest of the journey. Furthermore, the isMatch parameter indicates whether the Face Match passed successfully or not, returning isMatch: true
in case of success and false
in case of failure.
Events
Currently the SDK emits three types of events:
Error event details
The error event is of customEvent type, therefore, if you wish to obtain details regarding the reason for the error, you can consume the event.detail where you will find the following descriptions.
Example error event listener
Last updated