Web Library Event Handlers
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}}}"
}