> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/framework-plugins/flutter/componentes/captura-de-documentos.md).

# Identity document capture - SelphID

Document capture is performed with the ***SelphID Component***.

This component is responsible for capturing identity documents and analyzing the data obtained. Its main processes are:

* Internal management of cameras and permissions.
* Assists in the capture processes for the front and back of the document.
* Extraction of the information contained in the document.
* Obtaining the images of the front and back of the document, as well as other images included in the document: user's face, user's signature,...
* High level of configuration: different countries, languages, document types...

***

## Dependencies <a href="#id-2-dependencia" id="id-2-dependencia"></a>

### Flutter:

```yaml
dependencies:
  fphi_sdkmobile_selphid:
    hosted:
      name: fphi_sdkmobile_selphid
      url: https://facephicorp.jfrog.io/artifactory/api/pub/pub-pro-fphi/
    version: ^<version>
```

### Android - Gradle:

```kotlin
implementation "com.facephi.androidsdk:selphid_component:$version"
```

### iOS - CocoaPods:

```swift
pod 'FPHISDKSelphIDComponent', '~> $version'
```

## Available methods

This component contains several methods that perform different functionalities:

<table data-header-hidden><thead><tr><th width="233.64453125"></th><th></th></tr></thead><tbody><tr><td><strong>Method</strong></td><td><strong>Description</strong></td></tr><tr><td>startSelphIDWidget</td><td>Main document capture controller</td></tr></tbody></table>

## startSelphIDWidget Method <a href="#id-4-lanzamiento-simplificado" id="id-4-lanzamiento-simplificado"></a>

Once the SDK has been started and a new operation has been created, the component can be launched. Any of its controllers can be used to execute its functionality.

Face Capture launch:

```dart
@override
Future<Map> startSelphIDWidget({required String resourcesPath, required SelphIDConfiguration widgetConfigurationJSON}) async
{
  final Map result = await methodChannel.invokeMethod('selphid', {"resourcesPath": resourcesPath, "widgetConfigurationJSON": widgetConfigurationJSON.toJson()});
  return result;
}
```

## Basic configuration <a href="#id-5-configuracion-basica" id="id-5-configuracion-basica"></a>

To launch the current component, an object must be created ***SelphIDConfiguration*** which will be the configuration of the component controller.

The basic configuration required is as follows:

```dart
class SelphIDConfiguration{
  bool? mWizardMode;
  bool? mDebug;
  bool? mShowResultAfterCapture;
  bool? mShowTutorial;
  bool? mTutorialOnly;
  bool? mFullscreen;
  bool mGenerateRawImages;
  bool? mShowDiagnostic;
  bool? mShowPreviousTip;
  bool? mVibrationEnabled;
  double mJPGQuality;
  double? mTokenImageQuality;
  String? mSpecificData;
  String? mTranslationsContent;
  String? mViewsContent;
  String? mDocumentModels;
  String? mVideoFilename;
  String? mTokenPreviousCaptureData;
  int? mCameraId;
  dynamic mParams;
  SelphIDScanMode? mScanMode;
  SelphIDDocumentSide? mDocumentSide;
  SelphIDDocumentType? mDocumentType;
  SelphIDTimeout? mTimeout;
  SelphIDCompressFormat mCompressFormat;
}
```

### Advanced component configuration

Below are all the fields that are part of this class.

{% content-ref url="/pages/584cb61355bbbd302cae55fea7f93db0f0b6aaa9" %}
[SelphID Configuration](/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphid/selphid-configuracion.md)
{% endcontent-ref %}

***

## Receiving the result <a href="#id-6-recepcion-del-resultado" id="id-6-recepcion-del-resultado"></a>

The launch will return the information in format ***SelphIDResult***. It is possible to distinguish between a successful launch and an unsuccessful one:

```dart
class SelphIDResult
{
  final SdkFinishStatus finishStatus;
  final String finishStatusDescription;
  final String errorDiagnostic;
  final String? errorMessage;
  final String frontDocumentImage;
  final String backDocumentImage;
  final String rawBackDocument;
  final String rawFrontDocument;
  final String fingerprintImage;
  final String faceImage;
  final String signatureImage;
  final String tokenRawBackDocument;
  final String tokenRawFrontDocument;
  final String tokenFrontDocument;
  final String tokenBackDocument;
  final String tokenFaceImage;
  final String documentData;
  final String tokenOCR;
  final String documentCaptured;
  final double matchingSidesScore;
}
```

### Advanced component configuration

Below are all the fields that are part of this class.

{% content-ref url="/pages/04c6ff8b16c96b2ba5591eb861d1403a5205bba2" %}
[SelphID Result](/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphid/selphid-resultado.md)
{% endcontent-ref %}

## Component customization <a href="#id-8-personalizacion-del-componente" id="id-8-personalizacion-del-componente"></a>

In addition to the changes that can be made at SDK level (which are explained in the document on [Advanced settings](#id-1-introduccion)), this specific component allows its own customization.

{% content-ref url="/pages/9823e9f4fee029e1ef4b459dd0285befed87f5fc" %}
[SelphID - Component Customization](/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphid/selphid-personalizacion-del-componente.md)
{% endcontent-ref %}
