> 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-facial.md).

# Face Capture - Selphi

Face capture is performed with the Selphi Component.

Face capture is performed using the ***Selphi Component***.

This component captures a selfie of the user and then extracts the most important facial features. Its main processes are:

* Internal management of cameras and permissions.
* Guides the user through the face capture process.
* Generates templates containing the user's facial features and image.

***

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

### Flutter:

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

### Android - Gradle:

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

### iOS - CocoaPods:

```swift
s.dependency 'FPHISDKSelphiComponent', '~> $version'
```

## Available methods

This component contains several methods that perform different functions:

<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>startSelphiFaceWidget</td><td>Main Facial Recognition controller</td></tr></tbody></table>

## startSelphiFaceWidget method <a href="#id-4-lanzamiento-simplificado" id="id-4-lanzamiento-simplificado"></a>

Once the SDK has been initialized and a new operation has been created, the component can be launched. You can use any of its controllers to execute its functionality.

Launching face capture:

```kotlin
@override
Future<Map> startSelphiFaceWidget({
  required String resourcesPath,
  required SelphiFaceConfiguration widgetConfigurationJSON
}) async {
  final Map result = await methodChannel.invokeMethod('selphi',
      {"resourcesPath": resourcesPath, "widgetConfigurationJSON": widgetConfigurationJSON.toJson()}
  );
  return result;
}
```

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

To launch this component, create an object of type ***SelphiFaceConfiguration*** which will configure the component's controller.

The basic configuration required is as follows:

```dart
class SelphiFaceConfiguration {
  bool? mDebug;
  bool? mFullscreen;
  bool? mLogImages;
  bool? mStabilizationMode;
  bool? mTemplateRawOptimized;
  bool? mQRMode;
  bool? mShowResultAfterCapture;
  bool? mShowDiagnostic;
  bool? mShowTutorial;
  bool? mShowPreviousTip;
  bool? mVibrationEnabled;
  bool mEnableGenerateTemplateRaw;
  double mCropPercent;
  double mJPGQuality;
  String? mTranslationsContent;
  String? mViewsContent;
  String? mVideoFilename;
  int? mCameraId;
  int? mMoveSuccessfulAttempts;
  int? mMoveFailedAttempts;
  dynamic mParams;
  SelphiFaceLivenessMode? mLivenessMode;
  SelphiCompressFormat mCompressFormat;
  SelphiFaceExtractionDuration? mExtractionDuration;
  SelphiCamera mCameraPreferred;   
}
```

### Advanced component configuration

All the fields that are part of this class are detailed below.

{% content-ref url="/pages/df01df0f1d67a896ccc530e3c2b4f07c7f7e8a73" %}
[Selphi Configuration](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphi/selphi-configuracion.md)
{% endcontent-ref %}

***

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

The launch returns the information in SelphiFaceResult format. Successful and unsuccessful launches can be distinguished:

```dart
class SelphiFaceResult {
  final SdkFinishStatus finishStatus;
  final String finishStatusDescription;
  final String errorDiagnostic;
  final String? errorMessage;
  final String? templateRaw;
  final String? qrData;
  final String? bestImage;
  final String? bestImageCropped;
  final String? bestImageTemplateRaw;
  final String? livenessDiagnostic;
  final dynamic images;
}
```

{% content-ref url="/pages/8e63d4905bacdd6e1efd4dfb86492e5cd7ce35ea" %}
[Selphi Result](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphi/selphi-resultado.md)
{% endcontent-ref %}

## Customization of the component <a href="#id-8-personalizacion-del-componente" id="id-8-personalizacion-del-componente"></a>

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

{% content-ref url="/pages/79c1a959c22f161ec1f3cf5258279e6d0f863b18" %}
[Selphi - Component Customization](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphi/selphi-personalizacion-del-componente.md)
{% endcontent-ref %}
