VerifyMe Liveness Widget

VerifyMe has a smooth widget which helps you detect biometric spoofing attacks where a replica or imitation is presented to bypass the required identification and authentication steps

How to Generate Widget

Using the VerifyMe CDN-hosted javascript client library, you can install the Liveness widget into your application. You only have to add the script tag to your html document and insert basic configuration parameters and you'll be good to go.

Step 1: Add the Client Javascript Library

Include the script tag just before the end of the closing body tag of your desired html page where you wish to perform the liveness verification.

<script src="https://xpress.verifyme.ng/inline.js"></script>

Step 2: Configure the Javascript Client Library

At this point, you can now create a Liveness widget object by passing in an object containing public key and other fields containing the verification details.

new VerifyMePopupSetup({
key: public_key,
});

key (string, required)

This is the VerifyMe public key, you can find this on the dashboard

verification details

These are other details that are required for the liveness check verification

callback (function, required)

This callback takes one argument, this is called when your user has completed the liveness verification process.

Step 3: Handle a Successful Liveness Verification

On successful verification, the callback function that you supplied is called by the client library with an object as a parameter. The object contains a status field with a success value

callback: function (response) {
if (response.status == 'success') {
// on success
} else {
// on failed
}
}

Liveness Widget Example Script:

liveness_widget.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liveness Widget Sample Script</title>
</head>
<body>
<input type="text" id="liveness_lastname" />
<input type="text" id="liveness_firstname" />
<input type="text" id="liveness_phone" />
<select id="liveness_identity_type">
<option value="nin" selected="selected"> NIN </option>
<option value="bvn"> BVN </option>
</select>
<input type="text" id="liveness_identity_number" />
<button onclick="launchLiveness(event)">Launch</button>
<script src="https://xpress.verifyme.ng/inline.js"></script>
<script type="text/javascript">
function launchLiveness(event) {
event.preventDefault();
new VerifyMePopupSetup({
lastname: document.getElementById('liveness_lastname').value,
firstname: document.getElementById('liveness_firstname').value,
phone: document.getElementById('liveness_phone').value,
identityType: document.getElementById('liveness_identity_type').value,
identityNumber: document.getElementById('liveness_identity_number').value,
key: 'pk_',
productCode: 'PC',
callback: function (response) {
if (response.status == 'error') {
// on failed
} else {
// on success
}
}
});
}
</script>
</body>
</html>