-
Notifications
You must be signed in to change notification settings - Fork 9
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:
-
supportedis a boolean value indicating whether this device can run a Liveness transaction on the webpage -
grantedis a boolean or null value indicatingtrueif permission was granted,falseif permission was denied, ornullif permission was not requested -
testsis an object of test results mapping to their results. Ifsupportedorgrantedis false, then the relevant support test that failed the check will be set tofalseinsidetests
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.