Web SDK
The VX Web SDK unlocks the power of VX for your application. This allows you to set up your verification process one time while empowering you to dynamically change the user's Verification Experience.
What are the steps for getting set up?
1. Create Token
In order for the document scan/upload process to work you must submit a token within the parameters of the veratadModal
.
To get a token you must make an API call with your Veratad username and password. See link below for more details.
Create TokenTokens are only valid for 6 hours. It is recommended that you get a new token on each iFrame build.
2. Include CSS, JS and iFrame
Full Example
This example includes all parameters, functions and methods.
Functions
Name | Description |
onOpen() | Triggers when the modal is first opened on the page or with the |
onClose() | Triggers when the modal is closed by the user or with the |
onSuccess() | The document was successfully scanned or successfully uploaded if DCAMS+ is not active |
onFailure() | The document failed the scan process or was not uploaded successfully if DCAMS+ is not active |
onEmail() | The user has requested that they get an email with a link to scan. |
onQr() | The user pushed the "done" button after QR scanning. |
onError() | A general processing error occurred during the scan or upload process. |
onErrorToken() | An invalid token was supplied |
onErrorPending() | The user's document is currently in a |
onErrorAlreadyVerified() | The user is in a |
onErrorVelocity() | The user has already processed 3 attempts within a 24 hour period |
Methods
Name | Description |
open() | Open the modal. i.e. |
close() | Close the modal i.e. |
destroy() | Destroy the modal and all variables i.e. |
Parameters
Parameter | Required | Type | Description |
international | optional | boolean | If the upload should be treated as a non-US document. Default is |
fn | required | string | The customer's first name |
ln | required | string | The customer's last name |
addr | required | string | The customer's street address |
city | required | string | The customer's city |
state | required | string | The customer's state |
zip | required | string | The customer's zip code |
dob | required | string | The customer's Date of Birth (YYYYMMDD format) |
phone | optional | string | The customer's phone number formatted as any of the below: (555) 555-5555 555-555-5555 5555555555 |
required | string | The customer's email address | |
reference | optional | string | An arbitrary value that will be returned with the callback |
token | required | string | The token for the iFrame session |
styleToken | optional | string | You can create a style ID in the admin dashboard. Once created enter the value in this parameter to customize the iFrame style. |
qr | optional | boolean | If set to "true" then the user will be given a prompt to scan a QR code when they select the "Use My Phone" option when on desktop. |
additionalData | optional | object | Any additional data you would like sent back with the callback POST. This can be set with any key => value pairs. |
resultMessages | optional | object | See |
language | optional | string | If no language is specified then the system will default to English. All languages from the Google Translate API are supported. Click here to view. The value should be the ISO-639-1 Code. |
email_fallback | optional | boolean | The system will default to "true". If this is set to 'false" the user will never be given the option to send an email if they are having trouble with the QR. In order for this to work the "QR" attribute also needs to be set to "true". |
bypassDesktopIntro | optional | boolean | The system will default to "false". If you set this attribute to "true" then the user will go direct to either the QR or Email link flow depending on your QR settings. |
resultMessages
These are the messages displayed to the end user in the iFrame.
NOTE: If you do not want the user to be messaged in the iFrame you can simply run the veratadModal.close()
after one of the function callbacks.
That said, If you do not customize these messages then your users that get an email link sent to them will see the defaults on the page.
The user has passed verification or successfully uploaded if DCAMS+ is not active, but storage is active.
parameter | default message |
verificationSuccessTitle | Verification Success |
verificationSuccessSubTitle | You have passed verification |
Callback
Once a document is uploaded, the callback will fire. The callback will also fire on subsequent status updates. The email
or reference
values can be used to associate the upload on Veratad's side to a customer/order on your side.
You should always use the backend callback POST to get the official status of the customer/order. The frontend callback in the JS should only be used to message and route your customer on the frontend.
Set up your callback endpoint
Click the link to create your callback endpoint
Example
Body
Body (When Image Return is Active)
There is a setting when a company is not using the Veratad storage system to have the document images returned via the callback. If this setting is active then the callback body will be as follows.
Possible Status Values
status | description |
PASS | The document has passed verification |
PENDING | The document is under manual review |
FAIL | The document has failed verification |
Last updated