Event listeners
Last updated
Last updated
The SDK provides various event listeners to handle different events during the document capture process. These listeners allow you to execute custom logic when specific events occur.
The addEventListener
method is used to listen to events of the specified type
.
Parameters
type
(): The type of event to listen for (check for details).
listener
(function): The function to be executed when the event is triggered.
options
(object, optional): Additional options for the event listener
The removeEventListener
method is used to lto remove an event listener of the specified type
.
Parameters
type
(): The type of event to listen for (check for details).
callback
(function): The function to be removed.
options
(object, optional): Additional options for the event listener
Type
Description
"front_capture_started"
Triggered when the capture of the front of the document has started.
"back_capture_started"
Triggered when the capture of the back of the document has started.
"capture_invalid"
Triggered when an error occurs in some validation performed by the SDK.
"capture_failed"
Triggered when an error occurs that is not handled by the SDK.