Type Definitions
-
getTokenCallback() → {Promise.<string>}
-
Description
This callback is called when the SDK needs a valid token (because of a new request or an expired token).
The token must comes from the client's back-end. To get a token the client's back-end should call Identity API.Returns
-
onCameraAccessGrantedCallback( result ) → {Promise.<void>}
-
Description
This callback is called after the SDK tried to access to the camera, so the client can handle the camera interaction result and notify the user.
Parameters
Name Type Description resultCameraAccessResult Indicates whether the camera access was granted or not.
Returns
-
onErrorCallback( error ) → {Promise.<{shouldRetry: boolean}>}
-
Description
This callback is called if an error occurs when the SDK calls Identity API to verify the user, so the client can handle the error and decide whether to retry the operation.
Parameters
Name Type Description errorany The error that occurred.
Returns
-
MainCameraAccessResult
-
Description
This object describes the main result of the camera access.
Properties
Name Type Description GRANTEDstring value: "granted" - The camera access was granted.
DENIEDstring value: "denied" - The camera access was denied.
NO_CAMERAstring value: "no-camera" - The camera access was denied because there is no camera.
CAMERA_ERRORstring value: "camera-error" - The camera access was denied because of an error.
-
DetailedCameraAccessResult
-
Description
This object describes the detailed result of the camera access.
Properties
Name Type Description GRANTEDstring value: "granted" - The camera access was granted.
ABORT_ERRORstring value: "abort-error" - The camera access was denied because there some problem occured which prevented the device from being used.
NOT_ALLOWED_ERRORstring value: "not-allowed-error" - The camera access was denied because either the browser context was insecure (the page was loaded using HTTP rather than HTTPS) or the user is not permitted access to the device in the current session or globally.
NOT_FOUND_ERRORstring value: "not-found-error" - The camera access was denied because no media tracks of the type specified were found that satisfy the given constraints (Resolution: min: 320x240; ideal: 640x480).
NOT_READABLE_ERRORstring value: "not-readable-error" - The camera access was denied because a hardware error occured at the operating system/browser/web page which prevented the access to the device (although the user granted the permission).
OVERCONSTRAINED_ERRORstring value: "overconstrained-error" - The camera access was denied because no camera was found with the given constraints (Resolution: min: 320x240; ideal: 640x480).
SECURITY_ERRORstring value: "security-error" - The camera access was denied because user media support was disabled on the web page.
UNKNOWN_ERRORstring value: "unknown-error" - The camera access was denied because of an unknown error.