Only for integrations via Iframe
If you are not going to use the liveness process inside an iframe, you can use the redirectUrl parameter to redirect the user to the desired page.
To facilitate client-to-client communication without relying entirely on callbacks, we send events via postMessage. These events are only dispatched at the end of the process.
Oboarding
{ statusVerification: 'failed', statusOnboarding: 'failed_selfie' },
{ statusVerification: 'completed', statusOnboarding: 'selfie_completed' },
{ statusVerification: 'manual_approve_pending', statusOnboarding: 'selfie_sent' },
Biometric Identification
{ status: 'failed' },
{ status:Â 'validated'Â },
How to receive the events?
window.addEventListener('message', (event) => {
const allowedOrigin = 'LIVENESS_URL';
if (allowedOrigin !== '*' && event.origin !== allowedOrigin) {
console.warn('Message received from an untrusted origin')
return;
}
if (event.data && event.data.status === 'failed') {
console.log('Status received from the iframe:', event.data.status);
}
});