> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/sdk-lite/face-liveness-lite.md).

# Face Liveness Lite

Face Liveness Lite is a lightweight face liveness verification solution. It confirms that a real, live person is in front of the camera and rejects spoofing attempts such as photos, screens or masks. The mobile SDKs have a minimal footprint, and the final result is retrieved by your backend, never decided on the device.

## How it works

{% stepper %}
{% step %}

## Your backend requests a session token

Your backend requests a session token and stores the `tokenId` returned with it. See [Backend Setup — step 1](https://docs.caf.io/sdk-lite/setup/backend/setup.md).
{% endstep %}

{% step %}

## Your app runs the capture

Your app passes the `sessionToken` to the SDK as `mobileToken`, together with the `personId`, and starts the capture.
{% endstep %}

{% step %}

## The SDK returns a `signedResponse`

When the capture ends, on success or on failure, the SDK returns a `signedResponse` (a signed JWT). Your app forwards it to your backend.
{% endstep %}

{% step %}

## Your backend validates it and retrieves the result

Your backend verifies the `signedResponse` signature, checks that its `tokenId` matches the stored one, and retrieves the result with the `livenessAttemptId`. See [Backend Setup](https://docs.caf.io/sdk-lite/setup/backend/setup.md) and [Result Reference](https://docs.caf.io/sdk-lite/setup/backend/result-reference.md).
{% endstep %}
{% endstepper %}

## Platforms

| Platform | Get started                                                          | Errors                                                                   | Failures                                                                     |
| -------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| Android  | [Android setup](https://docs.caf.io/sdk-lite/setup/android.md)       | [Android errors](https://docs.caf.io/sdk-lite/error-handling/android.md) | [Mobile failures](https://docs.caf.io/sdk-lite/failure-handling/mobile.md)   |
| iOS      | [iOS setup](https://docs.caf.io/sdk-lite/setup/ios.md)               | [iOS errors](https://docs.caf.io/sdk-lite/error-handling/ios.md)         | [Mobile failures](https://docs.caf.io/sdk-lite/failure-handling/mobile.md)   |
| Backend  | [Backend setup](https://docs.caf.io/sdk-lite/setup/backend/setup.md) | [Backend errors](https://docs.caf.io/sdk-lite/error-handling/backend.md) | [Backend failures](https://docs.caf.io/sdk-lite/failure-handling/backend.md) |

## Regions

Face Liveness Lite runs in two isolated regions, US and Brazil: see [Regions](https://docs.caf.io/sdk-lite/setup/backend/setup.md#regions) for the hosts and rules. The SDK selects the region from the session token, starting at these versions:

| Platform        | Minimum version |
| --------------- | --------------- |
| iOS (CafSDKiOS) | 7.8.0           |
| Android         | 7.27.0          |

## Glossary

| Term                | Description                                                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `sessionToken`      | Token your backend requests for each attempt. The app passes it to the SDK as `mobileToken`.                      |
| `tokenId`           | Identifier of the session token. Your backend stores it and compares it with the one inside the `signedResponse`. |
| `personId`          | Identifier of the user, passed to the SDK.                                                                        |
| `signedResponse`    | Signed JWT returned by the SDK at the end of the capture. It carries identifiers only, not the liveness result.   |
| `livenessAttemptId` | Identifier of the attempt, read from the `signedResponse`. Used to retrieve the result.                           |
| Failure             | The capture ran but did not pass. The SDK returns a reason to guide the user, and a `signedResponse`.             |
| Error               | The run could not start or finish. No capture was assessed and no `signedResponse` is returned.                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.caf.io/sdk-lite/face-liveness-lite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
