Skip to content

Components Response

You can get the response of the component in the detail field of the event object.

For example:

const component = document.getElementsByTagName('face-capture')[0];
function listener(event) {
    if (event.detail.action === 'PROCESS_FINISHED' && event.detail.data.status === 1) {
        const response = event.detail.data.response;
        console.log(response);
    }
}
component.addEventListener('face-capture', listener);