GBG Developers

Guides   |   Using the Facematch Service

Using the Facematch Service

This guide explains how to use the Facematch service, which allows for a face image (also known as a selfie) to either be transferred from a file or bitmap source, or for an image to be taken with the camera in a mobile device and transferred. The GBG Identity Solution will receive the image and correlate it with photo identification extracted from previously scanned documents.

The JavaScript code snippet below expects the verificationId parameter from a previously scanned document.

function do_facematch() {
    return window.sdkInstance.performActivity({
        activity: GBG.IDaaS.Activities.FaceMatch, parameters: { verificationId: verification_id }
        .then((obj) => {
        .then(() => console.log("done facematch"))

When run, a button appears to allow the user to select an image or to enable the camera for submitting to the FaceMatch service.

The results can be extracted from the activity meta data (as with all other activities, you can explore the results by using Chrome Developer Tools console view to see the obj content output from the code snippet above).