Wrapper Event Handlers
updateConfig - will update the configuration used by the 'DVSOIDVC' object.
The updateConfig function has the following signature
updateConfig(newConfig: string)
Required Input Parameter
- newConfig - new web library configuration object that has been stringified using JSON.stringify
setApplicant - will reinitialize the wrapper with a new applicant ID.
The setApplicant function has the following signature
setApplicant(applicantId: string)
Required Input Parameters
- applicantID - a GUID that is generated by DIVE Online through the DIVE Online Web API
restart - will trigger the 'DVSOIDVC' object to be reloaaded, which is useful when updating the configuration.
showLoader - will display a loading spinner with an optional message to the user The showLoader function has the following signature
showLoader(val: boolean, bottomText?: string, topText?: string)
Required Input Parameters
- val - a true value will display the spinner and false will hide the spinner
Optional Input Parameters
- bottomText - a string that is displayed below the spinner
- topText - a string that is displayed above the spinne
onChange - function which will be called after each step completes.
Sample Input Parameter
{
"step": {
"index": 2, // step number
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQA...", // base 64 encoded image
"type": "pdf", // step type
"isAuto": false, // how was the image captured
"source": "file", // what is the source of the image
"trackString": "QAoeDUFOU0kgNjM2MDI2MDEwMkRMMDAzOTAyMj..." // the trackstring field is included for the pdf step type
}
}
onRetakeHook - function which will be called after the retake button is clicked
Sample Input Parameter
{
"step": {
"index": 3, // step number
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABA...", // base 64 encoded image
"type": "face", // step type
"isAuto": true, // how was the image captured
"source": "video" // what is the source of the image
}
}
onMounted - the function that will be called on the component mounted. This function doesn't return a value.
onReset - function which will be called after reset all the steps button are clicked
Sample Input Parameter
{
"steps": [
{
"index": 1, // step number
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...", // base 64 encoded image
"type": "front", // step type
"isAuto": false, // how was the image captured
"source": "file" // what is the source of the image
},
{
"index": 2,
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQAB...",
"type": "pdf",
"isAuto": false,
"source": "file",
"trackString": "QAoeDUFOU0kgNjM2MDI2MDEwMkRMMDAzOTAyMjZ..."
},
{
"index": 3,
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA...",
"type": "face",
"isAuto": false,
"source": "file"
}
],
"documentType": 1, // the selected document type is encoded with an integer
}
onCameraError - function which will be called in case the camera is not available
onReloaded - The function that will be called after the component finishes reloading. This function doesn't return a value.
onError - The function that will be called on error. The response value is the object with the error code and the message
{
"name": "HttpError",
"statusCode": 404,
"header": "Server Side Problems",
"content": "Please try again later"
}
submit - function which will be called after clicking the submit button
Sample Input Parameter
{
"event": "submit",
"steps": [
{
"index": 1,
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAA...",
"blob": {},
"type": "front",
"isAuto": false,
"source": "file"
},
{
"index": 2,
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAA...",
"blob": {},
"type": "pdf",
"isAuto": false,
"source": "file",
"trackString": "QAoeDUFOU0kgNjM2MDI2MDEwMkRMMDAzOTAy..."
},
{
"index": 3,
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAA...",
"blob": {},
"type": "face",
"isAuto": false,
"source": "file"
}
],
"documentType": 1,
"selectedDocumentType": "DL",
"metaData": "{\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36\",\"capturedMethod\":\"000\",\"version\":\"3.0.0\",\"logs\":{\"s\":{\"2\":44448,\"3\":9200,\"5\":27724}}}"
}