Skip to main content

Collecting SDK Returns

The .initialize() method

The .initialize() method is responsible for initializing the facial recognition and liveness proof component. From the execution of this method, the camera is initialized within the component to perform photo capture.

Rejection Scenarios:

  • Unsupported Browser:
{
status: 'FAILURE',
reason: 'UNSUPPORTED_BROWSER',
description: 'User browser is not supported.'
}
  • Not Mobile Device:
{
status: 'FAILURE',
reason: 'NOT_MOBILE_DEVICE',
description: 'User device is not mobile.'
}

The .open() method

This method is responsible for starting the capture, which will initiate the interaction with the user to collect the liveness proof. This method returns a Promise that is resolved with the captured photo key (image_key) as soon as the capture is finished.

Promise resolution:

{ 
status: string //
image_key: string; // Image key that identifies the image on the server to later be used for validation.
}
 {
status: "SUCCESS",
image_key: "d8a3b1c4-9e2f-47a5-8c3d-1b2e5...";
}

Promise rejection:

{
status: string;
reason: string;
description: string;
}

Rejection Scenarios:

  • User Canceled:

    {
    status: "FAILURE",
    reason: "USER_CANCELED",
    description: "User pressed the back button."
    }
  • Invalid Token: (Occurs when client_session_key is invalid or expired)

    {
    status: "FAILURE",
    reason: "INVALID_TOKEN",
    description: "Authentication token expired or invalid"
    }