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

Results

Results provided by the SelphID Widget component.

On this page we will explain the different ways to finish the Widget capture process.

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

Success stories

Successful capture and extraction

As soon as 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 it 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 handle 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 executing. These errors can occur in incorrect environments or configurations.

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

Error
Code
Description

Terminal exceptions

AndroidWebViewBehaviour

SPD_318

Error produced after executing the component 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's cameras.

PermissionsDenied

SPD_332

Error generated by not allowing the necessary permissions for the execution of the Widget.

CameraPermissionDenied

SPD_301

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

MicrophonePermissionDenied

SPD_319

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

SettingsError

SPD_320

Error caused by 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:


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