> 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/cordova/componentes/captura-facial.md).

# Face Capture - Selphi

## Introduction <a href="#id-1-introduccion" id="id-1-introduccion"></a>

Face Capture is performed with the ***Selphi Plugin***.

This component is responsible for capturing a user's selfie and subsequently extracting the most important facial features. Its main processes are:

* Internal management of cameras and permissions.
* Assistant in the user's face capture processes.
* Generation of the templates with the facial features and the user's image.

***

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

### Cordova:

```swift
cordova plugin add @facephi/sdk-selphi-cordova@<version>
```

### Android - Gradle:

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

### iOS - CocoaPods:

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

## Available methods

This component contains several methods that execute 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>launchSelphi</td><td>Main controller of Facial Recognition</td></tr></tbody></table>

## launchSelphi 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:

```javascript
exports.launchSelphi = function (cfg) {
    return new Promise((resolve, reject) => {
        var config = [];
        try {
            config = [{
                config: cfg
            }];
        } catch (e) {
            console.log(e);
        }

        exec(resolve, reject, 'SdkSelphi', 'launchSelphi', config);
    });
};
```

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

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

The basic configuration needed for this is as follows:

```typescript
export interface SelphiFaceConfiguration {
    resourcesPath: string;
    debug?: boolean;
    cropPercent?: boolean;
    stabilizationMode?: boolean;
    templateRawOptimized?: boolean;
    compressFormat?: SelphiCompressFormat;
    jpgQuality?: number;
    logImages?: boolean;
    livenessMode?: SelphiFaceLivenessMode;
    enableGenerateTemplateRaw?: boolean;
    showDiagnostic?: boolean;
    showTutorial?: boolean;
    showResultAfterCapture?: boolean;
    fullscreen?: boolean;
    qrMode?: boolean;
    translationsContent?: string;
    viewsContent?: string;
    cameraId?: number;
    params?: any;
    cameraFlashEnabled?: boolean;
    showPreviousTip?: boolean;
    extractionDuration?: SelphiExtractionDuration;
    cameraPreferred?: SelphiCamera;
    vibrationEnabled?: boolean;
    moveSuccessfulAttempts?: number;
    moveFailedAttempts?: number;   
}
```

### Advanced component configuration

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

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

***

## Result reception <a href="#id-6-recepcion-del-resultado" id="id-6-recepcion-del-resultado"></a>

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

<pre class="language-typescript"><code class="lang-typescript">export interface SelphiFaceResult {
<strong>    finishStatus: number;
</strong>    finishStatusDescription: string;
    errorType: string;
    errorMessage?: string;
    template?: string;
    templateRaw?: string;
    eyeGlassesScore?: number;
    templateScore?: number;
    qrData?: string;
    images?: [string];
    bestImage?: string;
    bestImageCropped?: string;
    livenessDiagnostic?: string;
    iad?: string;
}
</code></pre>

### Advanced component configuration

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

{% content-ref url="/pages/8e63d4905bacdd6e1efd4dfb86492e5cd7ce35ea" %}
[Selphi Result](/docs.facephi-en/sdks/sdk-mobile/framework-plugins/extras/selphi/selphi-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 the SDK level (which are explained in the document of [Advanced settings](#id-1-introduccion)), this specific component allows its own Customization.

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