Usage

Use the new javascript sdk. Migration guide found here After installing, and importing if required, you can use the web-component by following these steps:

Steps

1. Insert the following markup in your page / component

For Selfie Capture / Liveness Images only

<smart-camera-web>
</smart-camera-web>

For Selfie Capture / Liveness Images, and ID images

<smart-camera-web capture-id> </smart-camera-web>

For Selfie Capture / Liveness Images, and ID images (front and back)

<smart-camera-web capture-id="back"> </smart-camera-web>

To Select the Document Capture Mode for ID images add the document-capture-modes attribute with one of camera, upload, or a comma separated combination like camera,upload.

<smart-camera-web capture-id="back" document-capture-modes="camera,upload">
</smart-camera-web>

2. The following image should show up on your web page, if installation, and import, was successful.

Camera Access Permission

3. After granting access by clicking the button, you start by capturing a selfie and liveness images. You should see the capture screen below

Capture Selfie Screen
  • Click on Take a Selfie and follow the prompts on the screen to take both the Selfie and Liveness images.

  • At the end of the selfie capture process, you should see the Selfie review screen.

Selfie Review Screen

If the Selfie you took is satisfactory, select "Yes, use this one" or select "Re-take selfie" the selfie again running through steps 3 to 5.

4. If you intend to also capture the ID card image and added the capture-id attribute, additional screens related to ID card capture are displayed in addition to the Selfie related screens

  • Capture your ID card photo

ID Card Capture Screen
  • After taking the ID card photo, you should see the review screen

ID Card Review Screen

5. Handle the imagesComputed event in your page / component

On clicking the "Yes, use this one" button for the selfie / liveness images flow, or the "Approve" icon on the capture-id flow, an imagesComputed event will be published.

imagesComputed is a CustomEvent returning data — in e.detail — of the shape:

Here is a sample:

We advise that the partner_params published be merged with other partner_params sent with your request. You can read more about image_type_id here.

Here, we handle the imagesComputed event by sending the data to an endpoint.

The sample endpoint is built using our NodeJS Server to Server library and ExpressJS. This is the code below:

You can also build this using any of the other Server to Server libraries.

Last updated

Was this helpful?