> 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/caf-sdk/ios/standalone-modules/cafsdk.md).

# CafSDK

Welcome to the documentation for **CafSDK**, a unified and modular iOS SDK that provides robust solutions for document detection and face liveness validation.

***

* [Overview](#overview)
* [Features](#features)
* [Requirements](#requirements)
* [Installation](#installation)
  * [Swift Package Manager (SPM)](#swift-package-manager-spm)
  * [CocoaPods](#cocoapods)
* [Usage](#usage)
* [Module Architecture](#module-architecture)

***

## Overview

**CafSDK** is a comprehensive iOS SDK that integrates two primary functionalities:

* **Document Detection:** Powered by the [DocumentDetector](/caf-sdk/ios/standalone-modules/document-detector.md) framework and TensorFlow Lite.
* **Face Liveness Validation:** Offered via the [CafFaceLiveness](/caf-sdk/ios/standalone-modules/caffaceliveness.md) module, which supports both **iProov** and **FaceTec 2D** providers. These providers can be used independently or in combination, giving you the flexibility to tailor the solution to your needs.

This unified approach allows developers to include only the necessary modules, reducing bloat and simplifying integration.

***

## Features

* **Modularity:** Integrate the full SDK or select individual components.
* **Ease of Integration:** Supports both Swift Package Manager and CocoaPods.
* **Security and Accuracy:** Leverages advanced frameworks (e.g., TensorFlow Lite, iProov, FaceTec) for robust document and face validation.
* **Scalability:** Designed for iOS 13.0+ ensuring modern device compatibility.

***

## Requirements

| Deployment Info | Version |
| --------------- | ------- |
| **iOS Target**  | 13.0+   |
| **Xcode**       | 15.4+   |
| **Swift**       | 5.10+   |

***

## Installation

### Swift Package Manager (SPM)

To add **CafSDK** using SPM, include the following dependency in your `Package.swift` file:

```swift
dependencies: [
    .package(url: "https://github.com/combateafraude/caf-ios-sdk.git", from: "0.1.1")
]
```

Then, add the desired products to your app target:

```swift
.target(
    name: "YourApp",
    dependencies: [
        .product(name: "CafSDK", package: "CafSDK"),            // Full SDK
        .product(name: "DocumentDetector", package: "CafSDK"),    // Only DocumentDetector
        .product(name: "CafFaceLiveness", package: "CafSDK"),       // Only CafFaceLiveness
        .product(name: "IproovProvider", package: "CafSDK"),        // Optional iProov provider
        .product(name: "FaceTec2DProvider", package: "CafSDK"),     // Optional FaceTec 2D provider
    ]
)
```

### CocoaPods

To install using `CocoaPods`, add the following to your `Podfile`:

```bash
# Full SDK
pod 'CafSDK'

# Only DocumentDetector
pod 'CafSDK/DocumentDetector'

# Only CafFaceLiveness
pod 'CafSDK/CafFaceLiveness'

# Optional iProov provider
pod 'CafSDK/IproovProvider'

# Optional FaceTec 2D provider
pod 'CafSDK/FaceTec2DProvider'
```

## Usage

To import and use **DocumentDetector or CafFaceliveness** in your app, add the following import statement at the top of your Swift files:

```swift
import DocumentDetector
import CafFaceliveness
```

Documentation:

[DocumentDetector](/caf-sdk/ios/standalone-modules/document-detector.md)[CafFaceLiveness](/caf-sdk/ios/standalone-modules/caffaceliveness.md)

## Module Architecture

The unified CafSDK is organized into several modular components:

* `CafSDK`: The umbrella module for core functionalities.
* `DocumentDetector`: Provides secure document detection using TensorFlow Lite.
* `CafFaceLiveness`: Manages face liveness validation.
* `IproovProvider`: Integrates the iProov face liveness solution.
* `FaceTec2DProvider`: Integrates the FaceTec 2D face liveness solution.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.caf.io/caf-sdk/ios/standalone-modules/cafsdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
