Step 4a: GlobalGateway image capture

optional step


The Image Capture SDK enables users to capture and upload high-quality ID document images and selfies for identity verification. It further allows for data extraction from the submitted ID document images. It also supports document authentication and facial recognition to verify and authenticate the identity. The SDK leverages a device’s native camera application to acquire images for automatic analysis.

If you don't currently have the SDK and would like to add it to your website, please contact [email protected]

For additional information about the Image capture SDK please refer to here

At this point, you must have completed all of the steps mentioned in the link above.

This section covers the front end JavaScript code needed to take 3 photos.

When capturing an image, depending on your ID type, you’ll want to choose the correct capture method. We offer 4 versions in automatic mode which auto snaps the images as well as a manual mode which opens the camera app on your phone.

  • StartDocumentCapture
  • StartBarcodeCapture
  • StartPassportCapture
  • StartSelfieCapture

For the front image, you can initiate the capture as follows:
(It is recommended to set the timeout to 20 seconds, which will call StopTruliooCapture internally.)

function startDocumentCapture(){
      // Capture Driver Licence and ID Cards.
      StartDocumentCapture('Starting Document Capture...', timeoutInSecond, True, successCallback, ErrorCallback);

It will start a capture session and look for a rectangle document (driver licence, ID cards etc.). It works for both front and back of a document.

At this point the user will be guided to take a photo in automatic mode. If there's too much glare this process will advise the customer about this as well.

If the capture is successful the successCallback will be called, if it fails the ErrorCallback will be called. We recommend handling both scenarios as a part of your workflow.

The below image is for reference on how it will look on a mobile device:

For the Back image, you can re-initiate StartDocumentCapture if your document requires a full picture of the back or StartBarcodeCapture if you only require a 2D barcode. (Works for US and Canada Drivers License only.)

function startBarcode(){
      // Barcode Capture only for US and CA Driver Licence 
      StartBarcodeCapture('Starting Barcode Capture...', timeoutInSecond, True, successCallback, ErrorCallback);

The section below shows the workflows with the different capture mechanisms.
Please note, for passport there's no back image required.

After you've captured the back image and handled both callbacks (Success and Error), now comes time for the selfie with Liveness check.

You can initiate the selfie capture as follows:

function startSelfie(){
      // Capture Live Selfie 
      StartSelfieCapture('Starting Live Photo...', timeoutInSecond, True, successCallback, ErrorCallback);

Once you've initiated the auto selfie the user will be challenged to smile. Please note that liveness only works with auto.

The image below is for reference on how it will look on a mobile device:

If you received a successful callback in auto, you've now validated liveness and completed all three captures.

All you have to do now is to hand off the three base64 strings to the back-end application to perform the final 'Verify' step.

What’s Next
Did this page help you?