Skip to content

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 indicating true if permission was granted, false if permission was denied, or null if permission was not requested
  • tests is an object of test results mapping to their results. If supported or granted is false, then the relevant support test that failed the check will be set to false inside tests

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.

Clone this wiki locally