-
Notifications
You must be signed in to change notification settings - Fork 6
Liveness Support Checker Example
Will Morgan edited this page Mar 22, 2022
·
2 revisions
Below is how to check that a device is capable of running a Liveness transaction on a given webpage:
const checker = new IProovSupport(console, {
assuranceType: "liveness",
})
const { supported, granted, tests } = await checker.check({ emit: false })
Here is a breakdown of the results:
-
supported
is a boolean value indicating whether this device can run a Liveness transaction on the webpage -
granted
is a boolean or null value indicatingtrue
if permission was granted,false
if permission was denied, ornull
if permission was not requested -
tests
is an object of test results mapping to their results. Ifsupported
orgranted
is false, then the relevant support test that failed the check will be set tofalse
insidetests
To pre-warm permissions, instead of check, you will need to run:
const { supported, granted } = await checker.checkWithPermission()
If granted === false
, then either the camera or device motion permissions will have been denied by the user.