> 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/sdk-lite-english-pt-br/configuracao/ios/builder.md).

# Construtor

## Criando uma instância do SDK de Liveness

Instancie `CafFaceLivenessLiteSDK` diretamente e configure o comportamento por meio do construtor e `setup` parâmetros.

### Construtor

```swift
CafFaceLivenessLiteSDK(enableSecurity: Bool = true)
```

| Parâmetro        | Tipo | Obrigatório | Descrição                                                                                                                                                                            |
| ---------------- | ---- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `enableSecurity` | Bool | Não         | Ativa o monitoramento de segurança: detecção de jailbreak, detecção de instrumentação e monitoramento de dylib. Padrão: `true`. Desative apenas em ambientes de teste automatizados. |

### Parâmetros de configuração

De **3.0.0**, a configuração é fornecida para `setup` em vez de para `startSDK`.

| Parâmetro                  | Tipo                   | Obrigatório | Descrição                                                                                                                                                                                                        |
| -------------------------- | ---------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mobileToken`              | String                 | Sim         | O `sessionToken` o backend solicitado para esta tentativa. Veja [Configuração do backend](/sdk-lite/sdk-lite-english-pt-br/configuracao/backend/setup.md)                                                        |
| `personId`                 | String                 | Sim         | ID da pessoa para liveness                                                                                                                                                                                       |
| `ambiente`                 | CafEnvironment (enum)  | Não         | `.prod` (padrão), `.beta`, `.dev`                                                                                                                                                                                |
| `carregamento`             | Bool                   | Não         | Exibe a tela de carregamento do SDK (padrão: `true`)                                                                                                                                                             |
| `customLocalization`       | String?                | Não         | Use um prefixo personalizado para a tabela/pacote de strings (por exemplo, `"stringsBundle"`)                                                                                                                    |
| `customLocalizationBundle` | Bundle?                | Não         | Pacote que contém a tabela de strings personalizada (mapeia para iProov `options.stringsBundle`)                                                                                                                 |
| `uiCustomization`          | CerttaUiCustomization? | Não         | Branding visual opcional para a tela de liveness: barra de cabeçalho, prompt, área da máscara e fonte. Veja [Personalização da interface](/sdk-lite/sdk-lite-english-pt-br/configuracao/ios/ui-customization.md) |

{% hint style="info" %}
`customLocalization` corresponde ao nome da tabela de strings do iProov (omita a `.strings` extensão). Quando as strings estiverem fora do bundle principal do app (por exemplo, dentro de um framework redistribuído), passe também `customLocalizationBundle`. Veja o guia de localização do iProov: [Localização do iProov](https://github.com/iProov/ios/wiki/Localization).
{% endhint %}

### preaquecimento

```swift
sdk.prewarm()
```

Opcional. Solicita a sessão com antecedência para que `startSDK` possa abrir a câmera sem esperar pela rede. Não recebe parâmetros, não retorna nada e não faz nada antes de `setup`. A sessão em preaquecimento é válida por 90 segundos; se ela não estiver disponível quando você iniciar, o SDK volta para o fluxo normal. Veja [Iniciar SDK](/sdk-lite/sdk-lite-english-pt-br/configuracao/ios/start-sdk.md#prewarming-the-session-optional).

### Parâmetros de startSDK

| Parâmetro        | Tipo             | Obrigatório | Descrição                      |
| ---------------- | ---------------- | ----------- | ------------------------------ |
| `viewController` | UIViewController | Sim         | O view controller apresentador |

{% hint style="warning" %}
Chamar `startSDK` antes de `setup` relata `didFinishWithError(type: .invalidOptionsException, description:)`.
{% endhint %}

{% hint style="info" %}
De **2.0.0**, Face Auth (`executeFaceAuth`) não está mais disponível no Lite. Após uma captura bem-sucedida, o SDK inicia uma transação assíncrona e retorna apenas `signedResponse`; seu backend recupera o resultado final de liveness fora de banda.
{% endhint %}

### getVersion

```swift
let version = CafFaceLivenessLiteSDK.getVersion() // ex. "7.8.0"
```

Disponível desde **7.8.0**. Método estático que retorna a versão do SDK como uma `String`. Não precisa de instância nem de `setup`, o que o torna útil para logs e chamados de suporte.

### Exemplo

```swift
import CafFaceLivenessLite

final class YourViewController: UIViewController {
    private let sdk = CafFaceLivenessLiteSDK(enableSecurity: true)

    override func viewDidLoad() {
        super.viewDidLoad()
        sdk.delegate = self

        sdk.setup(
            mobileToken: "your_mobile_token",
            personId: "your_person_id",
            customLocalization: nil,
            customLocalizationBundle: nil,
            environment: .prod,
            loading: true
        )
        sdk.prewarm()
    }

    private func start() {
        sdk.startSDK(viewController: self)
    }
}
```


---

# 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/sdk-lite-english-pt-br/configuracao/ios/builder.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.
