> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/verify/liveness/integration/liveness-sdk/ios-sdk/liveness-integration.md).

# Liveness Integration

<figure><img src="/files/XqzM9obILBXi1W5Mr3yU" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Using ID Fraud Shield?** It runs as a complementary library inside this same liveness flow. The integration steps below stay the same. See ID Fraud Shield at the end of this page.
{% endhint %}

## Liveness Detection Flow

After successfully initializing the `vidaLiveness` framework, you can proceed with the liveness verification process.&#x20;

Follow these steps to seamlessly integrate liveness checks into your application.

### 1. Initiate the Liveness Flow&#x20;

Once the framework is initialized, initiate the liveness flow by calling the `startDetection` API from your `UIViewController`. This API kickstarts the process of capturing image frames, analyzing facial features, and determining user presence.

```swift
// Inside your UIViewController
vidaliveness.startDetection()
```

### 2. Release the Instance

Once the liveness process is completed, release the instance of `VIDALiveness` to optimize resource usage. Invoke the `release` API to safely release the allocated resources.

```swift
// Release the instance of VIDALiveness
vidaliveness.release()
```

{% hint style="info" %}
**Retrieve full liveness details (backend)**

Once the liveness flow returns a `transactionId`, your backend can fetch the complete liveness transaction record(scores, status, and metadata) — using the [Liveness Transaction Details API](https://app.gitbook.com/o/HFo4Mq4hPbfFvhTREpfY/s/C2s0IISjZwzGfw8dm215/~/edit/~/changes/169/verify/liveness/integration/api/api-reference/liveness-transaction-details-api).
{% endhint %}

## Backend-Managed Configurations

These features are configured per client by the VIDA team through OSS (our backend system). They require **no changes to your application code,** please continue using your existing SDK integration as-is. The SDK reads the configuration when it initializes.

To enable or change any of them, contact the VIDA support team.

#### **Color Flash**

An alternative liveness capture mode. Enabling or disabling it is handled entirely on the VIDA backend.

#### Video Liveness

**Available from:** iOS Liveness SDK v1.9.5 — see [Passive Liveness](/identity-stack/verify/liveness/overview/passive-liveness.md) for how it works.

Cannot be enabled together with Color Flash. If both are switched on, Color Flash takes precedence. The review screen is not supported for this liveness type.

#### Behavioral Biometrics

Part of ID Fraud Shield. Collects clipboard, copy-paste and typing signals during the flow.

**Available from:** iOS Liveness SDK v1.9.6

<table><thead><tr><th width="278.63671875">Setting</th><th>Description</th></tr></thead><tbody><tr><td><code>behavior_biometrics_enabled</code></td><td>Parent switch for all behavioral signals. When disabled, the two settings below have no effect.</td></tr><tr><td><code>clipboard_tracking</code></td><td>Clipboard and copy-paste events.</td></tr><tr><td><code>field_tracking</code></td><td>Typing, hesitation and field input events.</td></tr></tbody></table>

All three are **disabled by default on the SDK side**. If nothing is configured for your account, no behavioral signals are collected.

Enable these only for flows that contain input fields, such as name or date of birth. The liveness screen has no input fields, so these signals add no value there.

A configuration change takes effect at the **next SDK initialization**. It never changes behaviour in the middle of an active session.

## ID Fraud Shield

When ID Fraud Shield is enabled for your account, it runs as a complementary library within the liveness flow. It is not part of the Liveness SDK, and the integration steps above stay the same.

**To use it:** add the ID Fraud Shield dependency and provide a `userId` in the detector configuration. See Getting Started for the dependency and the `VidaLivenessRequest` parameters.

**About `userId`:** optional from Liveness SDK v1.9.6 onwards. If you do not provide one, the SDK uses a default value. We recommend setting your own so fraud rules can be applied per user. On earlier versions it is required when ID Fraud Shield is enabled.

For details about the library, see the ID Fraud Shield SDK documentation.
