For the complete documentation index, see llms.txt. This page is also available as Markdown.

Results

Results offered by the SelphID Widget component.

On this page we will explain the different possibilities for finishing the widget capture process.

Each detail of each event (attributes, data...) has been specified on the page of (events).

Success cases

Successful capture and extraction

When document capture is successful, the extracted results will be provided in the event extractionFinish (link).

Once this event is emitted, the logic to load the next view or widget should be implemented, adapting to the application context.

Here is an example:

import { type ExtractionFinishEvent } from "@facephi/selphid-web-component"

const selphidWidget = document.querySelector('facephi-selphid-widget');
selphidWidget.addEventListener('extractionFinish', onExtractionFinish);

function onExtractionFinish(event: CustomEvent<ExtractionFinishEvent>) {
  const extractionFinishDetail = event.detail.detail;
  console.log('extractionFinish:', extractionFinishDetail);

  // Procesar resultados en el backend
  saveResults(extractionFinishDetail.result.images.frontDocument, extractionFinishDetail.result.images.backDocument);

  // Cargar el siguiente widget o vista
  loadSelphiWidget();
}

Error cases

It is recommended to control the possible errors that may occur when processing the obtained data to avoid internal failures, incorrect use of the widget, or brute force attacks.

Error codes

The widget will throw an exception if any usage or internal error occurs.

Exceptions can be of two types:

  • Terminal exception: Error that will be thrown when the widget cannot continue its execution. These errors may occur in incorrect environments or configurations.

  • Extraction exception: Error that will be thrown during the capture or extraction flow. These errors allow the widget flow to be retried, since they are due to incorrect use of the widget by the user.

Error
Code
Description

Terminal exceptions

AndroidWebViewBehaviour

SPD_318

Error produced after the component is executed in a WebView in an Android environment.

UnknownInternalError

SPD_329

Internal error in the widget. If the error persists, it will be necessary to contact the Facephi support team

CameraHardwareError

SPD_305

Error produced during access to the device cameras.

PermissionsDenied

SPD_332

Error generated by not allowing the necessary permissions for the widget to run.

CameraPermissionDenied

SPD_301

Error due to not granting permission to use the device camera(s).

MicrophonePermissionDenied

SPD_319

Error due to not granting permission to use the device microphone(s).

SettingsError

SPD_320

Error produced by an incorrect configuration.

BrowserApiNotCompatible

SPD_321

Error produced by an unsupported browser.

Extraction exceptions

ErrorTimeout

SPD_001

Error generated when the established time limit for extraction has been exceeded.


Time limit exceeded during document capture

With the events extractionTimeout(link) and timeoutErrorButtonClick(link) it is possible to control when the user exceeds the set time or the attempts used.

Here is an example:


Capture attempts exhausted

As an alternative to the manual counting in the previous section, the property maxAttempts delegates the attempt limit to the widget itself. When they are exhausted, the widget stops retrying and emits maxAttemptsExceeded (link).

Here is an example:


The user closes the widget before document capture

This event is emitted when the user clicks the widget exit icon to cancel the extraction process. Once the button is pressed, the widget will close.

Code example


Terminal exceptions during the Widget lifecycle

This event is emitted when a system failure is detected. It can be used to identify and filter different types of errors encountered during the capture process.

Code example:


Last updated