vdid-sdk-web
v1.2.2
Published
Congrats! You just saved yourself hours of work by implementing suma's service. Let’s get you oriented with what’s here and how to use it.
Downloads
68
Readme
VDID User Guide
Congrats! You just saved yourself hours of work by implementing suma's service. Let’s get you oriented with what’s here and how to use it.
Commands
To install vdid-sdk-web, use:
npm i vdid-sdk-web
Configuration WebVerification using Javascript / Typescript
The first step is import our WebVerification like that:
import { WebVerification } from 'vdid-sdk-web'
Once you have imported the library, you have to initialize the object like this.
const vdid = new WebVerification(api-key)
You have to send the public api-key when you initialize it. api-key: string.
When you have created the verification and you get the uuid, you will call a function to start the process to upload files and send it, like the following line:
vdid.verifyIdentity(uuid)
uuid: string If you want to open a popup instead to redirect, you will call the function like the following line:
vdid.verifyIdentity(uuid, { method: 'popup' })
If you want to get the url, you will use the following function like the next line:
const url = vdid.getUrl({ uuid })
If you want to only captures images and get the url, you will use the following function like the next line:
const url = vdid.getUrlToOnlyCaptureImages({})
If you know what can of id will capture and get the url, you will call the function like the following lines:
const url = vdid.getUrlToOnlyCaptureImages({ typeId: 'id' }) -> If there will be two photos. const url = vdid.getUrlToOnlyCaptureImages({ typeId: 'passport' }) -> If it will be one photo.
If you want to modify min height and get the url, you will call the function like the following line:
const url = vdid.getUrlToOnlyCaptureImages({ minHeight: '100vh' })
If you want to modify max height and get the url, you will call the function like the following line:
const url = vdid.getUrlToOnlyCaptureImages({ maxHeight: '100vh' })