Callback / Listener interfaces
The Web SDK uses a single callback object passed to open() instead of platform-specific listener interfaces.
callback shape
const callback = {
on: {
success: (obj) => { /* ... */ },
error: (error) => { /* ... */ }
}
};
| Handler | Trigger |
|---|---|
on.success(obj) | Capture completed successfully |
on.error(error) | An error occurred during the session |
success payload
| Field | Type | Description |
|---|---|---|
obj.base64 | String | Captured image in Base64 |
obj.encrypted | String | JWT to be sent to the backend |
error payload
The error handler receives an ErrorBio instance with:
| Method | Description |
|---|---|
getCode() | Error code |
getDescription() | Error description |
See Error handling for the full list of error codes.