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

Simplified Launch

This section shows practical examples for integrating and using the Facephi SDK in Android mobile applications, adapted to the most common verification flows.

Initialize the SDK

The SDK works through a main controller (SDKController). Facephi will provide the apiKey license required for initialization.

val sdkConfig = SdkConfigurationData(
    sdkApplication = SdkApplication(application),
    licensing = LicensingOnline(EnvironmentLicensingData(
            apiKey = "...")
      )),
)

val result = SDKController.initSdk(sdkConfig)

when (result) {
  is SdkResult.Success -> Log.d("APP: INIT SDK: OK")
  is SdkResult.Error -> Log.d(
          "APP: INIT SDK: KO - ${result.error.name}"
        )
}

if (BuildConfig.DEBUG) {
    SDKController.enableDebugMode()
}

Start operation

Before launching any component, it is mandatory start an operation.

This method has the following input parameters:

  1. operationType: Indicates whether an ONBOARDING or AUTHENTICATION process will be performed.

  2. customerId: User identifier (controlled at application level).

  3. steps: List of operation steps if they have been defined previously.

  4. enableTracking: Indicates whether the operation should send Tracking events. By default it is true.

When the operation is created successfully, result.data contains a OperationResult with sessionId, operationId, type and customerId. These values identify the session and the active operation, and can be used for traceability or to link subsequent calls with the platform.

If the creation of a new operation returns an error of type INTERNAL_ERROR it is mainly due to a security. To investigate the cause, it is possible to retrieve the Token associated with the error, which provides additional information for analysis.

Component launch

Each component has its own controller and is launched from SDKController.

The result of launch maintains the common structure SdkResult: in Success, data contains the output specific to the launched component; in Error, error contains the specific error of the component or the SDK.


Security

The Android SDK includes a security system designed to detect and block potentially untrusted environments or those that may indicate attack attempts.

This mechanism is enabled by default, allows identifying situations that could compromise security, and prevents the SDK from running in contexts that are not considered secure:


Last updated