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

Getting Started with the SDK

About CafSDK

This technical documentation covers the implementation of CafSDK for React Native, detailing the configuration, initialization, execution of capture flows, and advanced customizations.

CafSDK is a unified SDK that integrates multiple modules for identity verification: Face Liveness (FL) and Document Detector (DD), executed sequentially with a unified configuration interface.

What is Face Liveness

Face Liveness is the module that validates the authenticity of a face captured by a photo application, ensuring that the image corresponds to a real person and not a spoofing attempt.

Technical characteristics:

  • URL configuration for authentication (authBaseUrl) and liveness verification (livenessBaseUrl)

  • Support for reverse proxy configuration with certificate pinning

  • Flags to enable screen capture and debug mode

  • Configurable retry attempts and face authentication execution

  • Support for multiple authentication providers

What is Document Detector

Document Detector is the module that enables the capture and processing of documents (e.g., ID card, social security card, passport, etc.).

Technical characteristics:

  • Configuration of a step-by-step flow defined by CafDocumentDetectorFlow for document capture

  • Support for multiple document types (RG, CNH, Passport, etc.)

  • Operational parameters, such as timeout, manual capture flags, and other settings

  • Possibility of using the camera for framing validations, or document file upload

  • Advanced customization options for UI, messages, and behavior


Installation

Requirements

To use the CafSDK modules in React Native, ensure that your project meets the minimum requirements:

React Native

Requirement
Version

React Native Version

0.73.x

Node.js

18

Android

Requirement
Version

Android SDK API - minimum version (minSdk)

26

Android SDK API - compile version (compileSdk)

36

Kotlin

1.9.10

Gradle

8.4

Android Gradle Plugin (AGP)

8.3.2

iOS

Requirement
Version

iOS Deployment Target

15.0

Xcode

26.0

Swift

5.10

Step 1: Install the SDK

Install the main SDK package:

Step 2: Configure Module Selection

When using Expo, you don't need to manually create the caf-modules-config.json file, it generates automatically from app.json.

To configure the SDK, add the following plugin to your app.json file:

To configure the SDK, create a caf-modules-config.json file in your app's root directory to control which native modules are included.

If you omit the SDK modules configuration, all modules are enabled by default, and iproov-lite is set as the default Face Liveness provider.

Set each module flag to true to include it, or false to exclude it.

livenessProviders accepts a string array .

iProov and Protobuf

  • iproov-lite: use when your app targets Protobuf JavaLite—the usual choice for a smaller binary footprint on Android.

  • iproov-full: use when you need Protobuf Java (full) together with iProov.

Fingerprint

The Fingerprint module is optional and is configured in caf-modules-config.json via the fingerprint property (boolean). It defaults to false, so you don't need to add the property unless you want to use it. To enable the module, explicitly set "fingerprint": true.

Requires a Face Liveness module. Fingerprint is collected as part of the liveness flow, so it is only bundled when faceLiveness or faceLivenessUI is also enabled. Setting "fingerprint": true without a liveness module enabled has no effect.

Important: Please contact CAF Support to request activation. If it is not enabled on our side, the SDK will not trigger the fingerprint library and no data will be sent, even if the property is set to true locally.

Step 3: iOS Configuration

Navigate to the ios/ directory of your React Native project and run:

  • This step is mandatory for iOS to correctly link the native modules and their required dependencies.

  • Always re-run pod install whenever native dependencies are added or updated.


Permissions

Android

For the modules to operate correctly, you must declare the following permissions in your AndroidManifest.xml:

For Face Liveness

Permission
Description
Necessity

android.permission.CAMERA

Allows access to the camera to capture images and perform face verification (liveness).

Mandatory

android.permission.INTERNET

Allows communication with authentication and verification services (HTTPS/WSS).

Mandatory

For Document Detector

Permission
Description
Necessity

android.permission.CAMERA

Allows access to the camera to capture document images.

Only for capture

android.permission.INTERNET

Allows captured images to be sent to servers for processing and validation.

Mandatory

android.permission.READ_EXTERNAL_STORAGE

Allows access to stored files and images for processing, if necessary.

Only for upload

iOS

For the SDK modules to function correctly, you must declare the following permissions in your Info.plist:

For Face Liveness:

Permission
Description
Necessity

NSCameraUsageDescription

Allows access to the camera to capture images and perform face verification (liveness).

Mandatory

Network access

Allows communication with authentication and verification services (HTTPS/WSS).

Mandatory

For Document Detector:

Permission
Description
Necessity

NSCameraUsageDescription

Allows access to the camera to capture document images.

Only for capture

Network access

Allows captured images to be sent to servers for processing and validation.

Mandatory

NSPhotoLibraryUsageDescription

Allows access to stored files and images for processing, if necessary.

Only for upload


Basic Implementation

Simple Example

Here's a basic implementation example:


Configuration

Language

Android

The language is automatically set according to the language configured on the device without any additional settings.

iOS

According to Apple's documentation, configuring Localizations and CFBundleLocalizations should be done in Xcode:

After these settings, the SDK will recognize the device's language.

Global Configuration

The useCafSdk hook serves as the central container for all configurations. The global configuration defines the execution order of the modules and the visual identity, and is passed to the initialize() function.

Returned values:

  • initialize: Function that initializes the SDK and applies module configurations. Returns Promise<boolean> indicating if all configurations were applied successfully. Accepts the global configuration and a callback function that applies module-specific configurations.

  • startSDK: Function that starts the SDK flow after initialization.

  • loadSession: Optional function to pre-load the user session before starting the SDK flow.

  • response: Object containing event handlers for the SDK execution (success, error, loading, etc.).

  • initialized: Boolean state indicating if the initialize function successfully applied all module configurations. This state can be used to verify that configurations were applied correctly before calling startSDK().

Essential parameters (passed to initialize()):

  • mobileToken: Token that authenticates the request and ensures that only authorized clients start the flow

  • personId: Unique user identifier for which the flow will be executed

  • environment: Defines the execution environment (PROD, BETA, DEV)

  • presentationOrder: Defines the sequence in which the modules will be executed

  • enableSecurityModule: Enables or disables the security module. Optional, default is true

Code example for creating the global configuration:

Session Pre-loading (Optional)

The loadSession() method allows you to pre-load the user session before starting the SDK flow. This improves the Face Liveness SDK opening time by preparing the session and camera initialization in advance, resulting in faster SDK startup when startSDK() is called.

When to use:

  • When you want to optimize the user experience by reducing the initial loading time

  • When you have the opportunity to pre-load the session before the user actually needs to start the flow

  • Particularly useful for Face Liveness module initialization

Code example:

Important notes:

  • This method is optional and can be called after initialize() but before start()

  • Pre-loading the session helps reduce the initial loading time when start() is eventually called

  • This is particularly beneficial for Face Liveness module initialization

Module-Specific Configuration

Face Liveness Configuration

Using the useCafFaceLiveness hook, you can configure the Face Liveness module. The configuration is applied when calling the applyCafFaceLiveness function:

Document Detector Configuration

Using the useCafDocumentDetector hook, you can configure the Document Detector module. The configuration is applied when calling the applyCafDocumentDetector function:


Event Handling

The response object from the useCafSdk hook contains properties that handle events generated during the execution of the capture flow:

  • log: Captures log messages with different levels (DEBUG, USAGE, INFO)

  • loading: Indicates the start of module processing

  • success: Upon successful completion, each module triggers an event containing a CafSuccessResponse[] object

  • error: If a problem occurs during execution, this event is triggered with the error message

  • failure: Indicates a face liveness failure, providing details about the type of failure

  • cancelled: Indicates that the user or system interrupted the flow

Error Types (CafErrorType)

Enum Case
Trigger Condition

CAMERA_PERMISSION

Camera access denied

UNSUPPORTED_DEVICE

Unsupported device specs

NETWORK_EXCEPTION

Network connectivity issues

SERVER_EXCEPTION

Backend processing failure

TOKEN_EXCEPTION

Invalid/expired token

CAPTURE_ALREADY_ACTIVE_EXCEPTION

Concurrent capture session

UNEXPECTED_ERROR_EXCEPTION

Critical unrecoverable error

USER_TIMEOUT_EXCEPTION

Capture timeout exceeded

IMAGE_NOT_FOUND_EXCEPTION

Missing image data

TOO_MANY_REQUESTS_EXCEPTION

API rate limit exceeded

UNKNOWN_EXCEPTION

Unclassified error

LIBRARY_EXCEPTION

Low-level framework error

PERMISSION_EXCEPTION

Missing system permissions

INVALID_EXCEPTION

Invalid response received

SEQUENCE_INVALID

Invalid operation sequence

LIVENESS_EXCEPTION

Face liveness specific error

FINGERPRINT_EXCEPTION

Fingerprint related error

STORAGE_EXCEPTION

Storage access error

PROXY_EXCEPTION

Proxy configuration error

SECURITY_EXCEPTION

Security validation error

BRIDGE_EXCEPTION

Native ↔ React Native bridge communication error

Failure Types (CafFailureType)

Enum Case
Trigger Condition
GPA
LA

UNKNOWN

Generic failure

TOO_MUCH_MOVEMENT

Excessive head motion

TOO_BRIGHT

Over-illumination

TOO_DARK

Low light conditions

MISALIGNED_FACE

Face alignment failure

FACE_TOO_FAR

Face too distant

FACE_TOO_CLOSE

Face too close

SUNGLASSES

Eye-obscuring eyewear

OBSCURED_FACE

Partial face obstruction

EYES_CLOSED

Closed eyes during capture

MULTIPLE_FACES

Multiple faces detected

✅️

✅️

BACKGROUND_ISSUE

Unsuitable background

DEVICE_ISSUE

Incompatible device

EYEWEAR

Eyewear detected

FACE_NOT_FOUND

Face detection failure

FRAMES_BLURRY

Blurry frames detected

MOTION_ISSUE

Device motion error

LIGHTING_ISSUES

Poor lighting conditions

REJECTED

Transaction rejected

SYSTEM_ERROR

Internal system error

TIMEOUT

Session timeout

USER_NOT_FOUND

User lookup failure

DEVICE_RESTART

Device state error

PROCESSING_FAULT

Processing error


Document Types

Supported Documents (CafDocument)

Name
Description

RG_FRONT

Front side of the RG document, where the photo is located

RG_BACK

Back side of the RG document

RG_FULL

Open RG document, displaying both the front and back sides together

CNH_FRONT

Front side of the CNH document, where the photo is located

CNH_BACK

Back side of the CNH document

CNH_FULL

Open CNH document, displaying both the front and back sides together

CRLV

CRLV document

RNE_FRONT

Front side of the RNE or RNM document

RNE_BACK

Back side of the RNE or RNM document

CTPS_FRONT

Front side of the CTPS document, where the photo is located

CTPS_BACK

Back side of the CTPS document

PASSPORT

Passport document, displaying the photo and personal data

ANY

Allows submission of any type of document, including all those listed above or any other unclassified document

Supported File Formats (CafFileFormat)

Type
Value

PNG

image/png

JPG

image/jpg

JPEG

image/jpeg

PDF

application/pdf

HEIF

image/heif

HEIC

image/heic


Advanced Configuration

Face Liveness UI Configuration

When using the UI module, you can customize instruction screens:

Document Detector UI Configuration

Proxy Configuration

For Document Detector proxy settings:

Message Customization

Customize messages displayed during the capture flow:


Complete Implementation Example

Here's a complete example showing both Face Liveness UI and Document Detector UI:


ProGuard/R8 Rules

Add these ProGuard/R8 rules to your proguard-rules.pro file for Android:


Technical Support and Usage Tips

Technical Support If you have any questions or difficulties with the integration, contact Caf's technical support.

Usage Tips

  • Run tests: Perform tests on real devices to validate requirements and flow performance

  • Explore customizations: Use advanced customization options to tailor the flow to your project's needs

  • Monitor performance: Integrate monitoring tools to track logs and the flow's performance in production

  • Handle errors gracefully: Implement proper error handling for all possible error and failure scenarios

  • Test with different devices: Ensure compatibility across various device specifications and screen sizes


Known issues

Crash: Screen fragments should never be restored

Description

In React Native applications that consume native Android SDKs, a crash may occur when the operating system recreates the main Activity after it has been destroyed in the background. The typical error displayed is:

Context

Android may destroy background processes to free up system resources. When the user returns to the application, the system attempts to restore the previous Activity state, including screen fragments. The react-native-screens library, used for navigation management, does not support this behavior by default and throws an exception.

Solution

Add the following override to your project's MainActivity.kt file, as recommended in the react-native-screens documentation:

By setting RNScreensFragmentFactory as the fragment factory before calling super.onCreate(), the library can properly handle fragment restoration when the Activity is recreated.

Impact

This change allows the application to gracefully handle Activity recreation scenarios without crashing, maintaining a seamless user experience even when the system reclaims resources in the background.


Release Notes

@caf.io/[email protected]

Release date

  • 08/14/2026

Highlights

  • Android 16 compatibility: Updated React Native module to support Android 16 (compileSdk / targetSdk 36), aligning with Google Play requirements for apps targeting recent Android versions.

Fixes

Face Liveness: Fixed an issue in the Payface flow where a failed face validation could still be reported as success. The SDK now correctly treats validation failures and shows the appropriate message to the user.

Document Detector: Fixed capture and upload issues on tablets and devices in landscape mode, including a brief incorrect image orientation flash in the preview, auto-capture failures with misaligned final photos, and minor UI adjustments to layout margins and the close button.

Updates

  • React Native Android module compileSdk / targetSdk updated to 36.

@caf.io/[email protected]

Release date

  • 08-03-2026

Highlights

  • Optional Fingerprint module: Control the inclusion of the fingerprint feature directly from caf-modules-config.json. It is disabled by default, ensuring you only include the dependency when strictly necessary.

Updates

  • New fingerprint boolean field in caf-modules-config.json for Android and iOS.

@caf.io/[email protected]

Release date

  • 07-06-2026

Breaking Changes

The intermediate configuration wrapper object was removed from all standalone module hooks. Configuration fields are now passed directly on the object.

Affected hooks:

  • applyCafDocumentDetector()

  • applyCafDocumentDetectorUI()

  • applyCafFaceLiveness()

  • applyCafFaceLivenessUI()

Renamed configuration types

The BuilderConfiguration interfaces were removed. The public configuration types are now the flat Configuration interfaces:

Removed (4.x)
Use instead (5.0.0)

CafDocumentDetectorBuilderConfiguration

CafDocumentDetectorConfiguration

CafFaceLivenessBuilderConfiguration

CafFaceLivenessConfiguration

CafDocumentDetectorUIBuilderInstructionScreenConfiguration

CafDocumentDetectorUIInstructionScreenConfiguration

CafDocumentDetectorUIBuilderDocumentSelectionScreenConfiguration

CafDocumentDetectorUIDocumentSelectionScreenConfiguration

CafFaceLivenessUIBuilderInstructionScreenConfiguration

CafFaceLivenessUIInstructionScreenConfiguration

CafDocumentDetectorConfiguration and CafFaceLivenessConfiguration are no longer wrappers around a nested configuration — they now hold the fields directly. CafDocumentDetectorUIConfiguration and CafFaceLivenessUIConfiguration now extend the base configuration instead of nesting it.

Renamed UI configuration fields

Removed field (4.x)
Use instead (5.0.0)

instructionScreenConfiguration

instructionScreen

documentSelectionScreenConfiguration

documentSelectionScreen

Response state behavior

The useCafSdk response lifecycle changed and may require adjustments if you relied on the previous implicit state resets:

  • initialize() now resets the response object (success, failure, error, cancelled, log, loading) at the start of every call.

  • The Success, Failure, Error, and Cancelled events now all set initialized back to false.

  • The Loading and Loaded events no longer clear success / failure / error / cancelled — they only update the loading flag.

Features

  • New error type CafErrorType.BRIDGE_EXCEPTION: emitted when the bridge receives an invalid/empty JSON payload or fails to map the configuration, instead of failing silently.

  • Instruction screen toggle for Face Liveness UI: new optional enable?: boolean (default true) on CafFaceLivenessUIInstructionScreenConfiguration, matching the Document Detector UI instruction screen.

Migration Guide - 4.x → 5.0.0

The public bridge contract (native method names, event names such as CafUnifiedEvent.*, and response payload keys like moduleName / signedResponse) is unchanged. The only migration work is on the TypeScript configuration objects you pass to the module hooks.

1. Remove the nested configuration wrapper

Move every field out of the configuration object and pass it directly.

Document Detector

Face Liveness

2. Update the UI hooks (config + renamed fields)

Document Detector UI

Face Liveness UI

3. Update your type imports

If you imported any of the removed types, rename them:

4. Review your response handling (optional)

If your app depended on the old side effect where a Loading / Loaded event cleared success / failure / error, handle those resets explicitly. Note that initialize() now clears the response at the start of each run.

@caf.io/[email protected]

Release date

  • 07-20-2026

Fixes

  • Race conditions during the return of the Success Event

@caf.io/[email protected]

Release date

  • 06-10-2026

Fixes

  • Maven CDN Fortface not found

@caf.io/[email protected]

Release date

  • 06-10-2026

Fixes

  • Maven CDN Fortface not found

@caf.io/[email protected]

Release date

  • 06-10-2026

Fixes

  • Maven CDN Fortface not found

@caf.io/[email protected]

Release date

  • 06-09-2026

Updates

  • Payface Liveness Provider (Android): Update version from 1.18.2 to 1.19.2.

  • Payface Liveness Provider (iOS): Update version from 1.5.2 to 1.8.2.

Fixes

FaceLiveness

  • Infinite loading error occurs when the SDK returns an error.

  • First initialization not working when using Payface provider.

@caf.io/[email protected]

Release date

  • 04-27-2026

Features

  • Configurable Face Liveness providers: Choose iproov-lite, iproov-full, payface, and/or facetec from caf-modules-config.json instead of relying on implicit native defaults.

Updates

  • Liveness provider configuration:

    • New livenessProviders field in caf-modules-config.json for Android and iOS.

    • Documented Protobuf JavaLite vs Protobuf Java mapping for iproov-lite vs iproov-full.

    • Clarified multi-provider setups using an array, and the PayFace + iProov Lite requirement.

  • iProov Liveness Provider: Documentation and defaults updated to reflect the new provider selection model.

  • Android ProGuard / R8: If R8 reports missing classes for lint stubs shipped with the SDK, add the following to proguard-rules.pro (also listed under ProGuard/R8 Rules):

@caf.io/[email protected]

Release date

  • 02/09/2026

Update

  • Dependency update: Updated iProov version from 10.2.0 to 11.1.0 in Android.

  • Dependency update: Updated iProov version from 12.2.1 to 13.1.0 in iOS.

Android & iOS

  • New failure types: Added new failure to CafFailureType for better failure handling:

    • BACKGROUND_ISSUE

    • DEVICE_ISSUE

    • EYEWEAR

    • FACE_NOT_FOUND

    • FRAMES_BLURRY

    • MOTION_ISSUE

    • LIGHTING_ISSUES

    • REJECTED

    • SYSTEM_ERROR

    • TIMEOUT

    • USER_NOT_FOUND

    • DEVICE_RESTART

    • PROCESSING_FAULT

@caf.io/[email protected]

Release date

  • 02/02/2026

Features

  • New CafSecurity module: Added a new module with security validations.

    • New configuration flag: enableSecurityModule in CafSdkConfiguration with default value true

Fixes

  • FaceLiveness

    • Fixed sessions creation erros.

    • Fixed color tint on remote images in the Instructions screen.

@caf.io/[email protected]

Release date

  • 01/12/2026

Features

  • PayFace (Fortface) Provider Integration: Optional Face Liveness provider now available

    • New property payFaceDebugMode in CafFaceLivenessConfig to enable debug mode for the PayFace provider.

Fixes

  • Fixed crashes in Document Detector module: Resolved multiple crashes related to activity lifecycle management, including initialization, pause, and resume states.

  • Fixed crashes related to camera lifecycle: Improved camera resource management and thread lifecycle to prevent crashes during SDK shutdown and state transitions.

  • Fixed crashes in UI components: Resolved theme compatibility issues and fragment transaction exceptions to ensure proper UI behavior.

  • Fixed crashes in network requests: Corrected response body handling to prevent errors when reading network responses.

  • Fixed crashes in data access: Improved cursor initialization and validation before accessing database data.

  • Fixed ANR in Document Controller: Optimized document controller instance checks to prevent application not responding issues.

  • Internal improvements and corrections: Additional stability enhancements and bug fixes.

@caf.io/[email protected]

Release date

  • 11/27/2025

Breaking Changes

Race Condition Prevention:

To prevent race conditions, the following functions now return Promise<boolean>:

  • initialize(): Now returns Promise<boolean>. The callback parameter also returns Promise<boolean>.

  • applyCafFaceLiveness(): Now returns Promise<boolean>.

  • applyCafFaceLivenessUI(): Now returns Promise<boolean>.

New State: initialized

A new initialized state is returned from the useCafSdk hook. This state allows you to verify if the initialize function successfully applied the module configurations.

The settings of the modules now are set in the functions initialize, applyCafDocumentDetector, applyCafFaceLiveness, applyCafDocumentDetectorUI, applyCafFaceLivenessUI.

Migration Example:

Fixes

Document Detector / Document Detector UI

  • Fixed crash when used empty flow in CafDocumentDetectorConfig: This issue was causing the SDK to close immediately during opening the document capture flow. Now the SDK will emit a new error event CafErrorType.LIBRARY_EXCEPTION with the message "Empty document options".

  • Fixed error when use loadSession in Document Detector module: This issue was causing the SDK to close immediately during opening the document capture flow. Now the sdk will not emit a error SEQUENCE_INVALID.

@caf.io/[email protected]

Release date

  • 11/17/2025

Features

SDK Initialization

  • New Methods:

    • loadSession(): Pre-loads the user session before starting the SDK flow. This improves the SDK opening time by preparing the session and camera initialization in advance, resulting in faster SDK startup when start() is called. This method is optional and can be called after initialize() but before start().

    • start(): Starts the SDK flow after configuration has been built. This method initiates the sequential execution of the configured modules.

Response

  • New Response:

    • response.success: An array of CafSuccessResponse objects.

Document Detector / Document Detector UI

Android

  • Manual capture mode as default: Manual capture mode from the start is now set as the default, due to difficulties in capture using automatic mode.

  • Analytics logs: Added detailed analytics logs to monitor document capture and upload details. These logs record messages, capture modes, fallback time, and sensors.

iOS

  • Manual capture mode as default: Manual capture mode from the start is now set as the default, due to difficulties in capture using automatic mode.

Breaking Changes

  • SDK Initialization Flow:

    • Previously, initialize() would automatically start the SDK after building configurations.

    • Now, initialize() only builds the SDK configurations and does not start the SDK automatically.

    • You must explicitly call startSDK() after initialize() to actually start the SDK flow.

    • The recommended flow is: initialize() → (optional) loadSession()startSDK()

Fixes

Document Detector / Document Detector UI

Android

  • Fixed crash "Image is already closed": This issue was causing the SDK to close immediately during document capture.

  • Fixed crash when used empty flow in CafDocumentDetectorConfig: This issue was causing the SDK to close immediately during opening the document capture flow. Now the SDK will emit a new error event CafErrorType.LIBRARY_EXCEPTION with the message "Empty document options".

  • Improved error messaging: Improved error messaging for incorrect document type detection to provide more accurate feedback during document validation.

  • Fallback on capture mode: Improved state management for capture mode transitions to ensure consistent and reliable behavior when manual and automatic capture modes interact.

  • Layout: Improved readability with increased line spacing and updated margins for more consistent layout and visual balance.

  • UI Improvements: Prevented text overflow in the document detector by enabling truncation for long titles and step names and adjusting spacing.

  • Light sensor deactivation: The light sensor has been disabled during the capture flow. Previously, the SDK used the device's light sensor to display the "Environment too dark" message, blocking capture until the sensor detected good lighting.

  • Messages deactivation during manual capture: Messages during manual capture have been disabled to avoid friction during the capture flow.

iOS

  • Error Messaging: Improved error messaging for incorrect document type detection to provide more accurate feedback during document validation.

  • Attestation Reporting: More detailed attestation error reporting (network/invalid token/invalid response) with safer error handling.

  • Document Identification: Fixed issue where document identification was not being displayed on the image capture screen even without custom configuration.

@caf.io/[email protected]

Release date

  • 10/15/2025

Highlights

  • 16kb page size support on Android

Features

  • Group Labels: Optional group labels on the Document Selection screen to show custom titles and descriptions per document group (RG, CNH, Passport, etc.).

Fixes

Android

  • Analytics improvements: Improved error reporting across face liveness flows: clearer network/server distinctions, precise camera permission handling.

  • DocumentDetector: stopped auto-enabling document preview when not explicitly configured.

@caf.io/[email protected]

Highlights

  • Unified SDK: Complete consolidation of all CAF modules into a single package, eliminating the need for multiple separate dependencies

  • Simplified Integration: Streamlined installation and configuration process with unified module management

  • Enhanced TypeScript Support: All type definitions consolidated into the main SDK package for better development experience

  • Module Configuration: Added comprehensive module configuration system for flexible SDK setup

Breaking Changes

  • Dependency Consolidation: The following packages are no longer required and should be removed from your project:

    • @caf.io/react-native-face-liveness

    • @caf.io/react-native-face-liveness-ui

    • @caf.io/react-native-document-detector

    • @caf.io/react-native-document-detector-ui

  • Type Definitions Migration: All TypeScript types have been moved to @caf.io/react-native-sdk

    • Remove type imports from individual packages

    • Import all types from @caf.io/react-native-sdk

  • Module Configuration: New configuration system using caf-modules-config.json file

    • Modules must be explicitly enabled/disabled in the configuration file

    • If no configuration file is provided, all modules are included by default

Features

  • Module Configuration System:

    • caf-modules-config.json: New configuration file in project root to specify which modules to include

    • Available modules:

      • documentDetector: Enable/disable Document Detector module

      • faceLiveness: Enable/disable Face Liveness module

      • documentDetectorUI: Enable/disable Document Detector UI module

      • faceLivenessUI: Enable/disable Face Liveness UI module

    • Example configuration:

  • Unified Error Handling: Consistent error handling across all modules

  • Improved Performance: Optimized bundle size and runtime performance through selective module inclusion

  • Enhanced Analytics: Unified analytics tracking across all modules

Fixes

iOS

  • Race Condition Fix: Resolved race condition that prevented SDK from opening on iOS devices

  • Memory Management: Improved memory handling during module transitions

  • Navigation Issues: Fixed nested navigation problems in iOS

Android

  • Permission Handling: Enhanced camera permission error reporting with distinct error classification

  • Network Stability: Improved network error handling and retry mechanisms

  • Build Compatibility: Updated build configurations for better compatibility

Cross-Platform

  • Error Reporting: Enhanced server error message clarity by extracting and surfacing raw error payloads

  • Loading States: Improved loading screen behavior and state management

  • Module Lifecycle: Better handling of module initialization and cleanup

Migration Guide

To migrate from individual packages to the unified SDK:

  1. Remove old dependencies:

  2. Install the unified SDK:

  3. Create module configuration file: Create caf-modules-config.json in your project root:

  4. Update imports:

  5. Implementation remains the same: Your existing implementation code does not need to change. The hooks and their usage remain identical:

@caf.io/[email protected]

New Features

  • New Types:

    • CafErrorType and CafFailureType enums added to the SDK

  • New Properties:

    • CafSdkBuilderConfiguration now has enableTransitionScreens property to enable/disable transition screens between modules

    • CafColorConfiguration now has dialogBackgroundColor and dialogBorderColor properties for dialog customization

@caf.io/[email protected]

New Features

  • Internal Improvements: Enhanced internal handling of document capture flows, improving performance and reliability

@caf.io/[email protected]

New Features

  • Internal Improvements: Enhanced internal handling of document capture flows, improving performance and reliability

@caf.io/[email protected]

New Features

  • Internal Improvements: Enhanced internal handling of document capture flows, improving performance and reliability

@caf.io/[email protected]

New Features

  • New Properties:

    • CafDocumentDetectorUIBuilderInstructionScreenConfiguration now has enable property to customize the instruction screen

@caf.io/[email protected]

New Features

  • Implementation: New executeFaceAuth property in Face Liveness modules for more granular control over face authentication

@caf.io/[email protected]

New Features

  • New Property: executeFaceAuth property allows for more granular control over the face authentication process

@caf.io/[email protected]

New Features

  • New Property: executeFaceAuth property allows for more granular control over the face authentication process

@caf.io/[email protected]

New Features

  • Internal Improvements: Enhanced internal handling of document capture flows, improving performance and reliability

@caf.io/[email protected]

New Features

  • Internal Improvements: Enhanced internal handling of document capture flows, improving performance and reliability

@caf.io/[email protected]

New Features

  • Introducing @caf.io/react-native-sdk: A unified SDK for integrating both Face Liveness and Document Detector modules in React Native applications

  • Builder Pattern Support: Simplified setup using CafSdkBuilderConfiguration, allowing type-safe configuration and modular composition

  • Unified Configuration Model: Manage execution order (presentationOrder), UI theming (CafColorConfiguration), and flow behavior in a centralized way

  • Consistent Module Handling: Shared authentication, environment (CafEnvironment), logging (CafLog), and response structure across all modules

  • Simplified Integration: React hook for initializing and managing the full SDK lifecycle

  • Live State Tracking: Provides a unified response object with real-time updates on loading, cancellation, success, failure, and logs

  • Manual Triggering: Exposes initialize() to start the flow after native configuration is complete

  • Built-in Event Management: Listens and reacts to all CafUnifiedEvent emissions, abstracting the native communication layer

Runtime and Response Handling

  • Unified Response Interface: CafResponse includes structured result types:

    • success using CafSuccessResponse

    • failure using CafFailureResponse

    • log, loading, cancelled, and error states

  • Strongly Typed Module Responses:

    • CafDocumentDetectorResult

    • CafFaceLivenessResult

Module Support

  • Supported modules through CafModuleType enum:

    • DOCUMENT_DETECTOR

    • DOCUMENT_DETECTOR_UI

    • FACE_LIVENESS

    • FACE_LIVENESS_UI

Configuration Enhancements

  • Flexible UI Customization:

    • Color theming via CafColorConfiguration

    • Custom confirmation step content via CafConfirmationNextStepContentConfiguration

  • Failure & Logging Support:

    • Enum-based failure types (CafFailureType)

    • Structured logs with log levels (CafLogLevel)

Breaking Changes

  • New Integration Module: @caf.io/react-native-sdk replaces any previous isolated implementations

@caf.io/[email protected]

New Features

  • Modular SDK Integration: The Face Liveness module is now available as a standalone package for modular usage within the new @caf.io/react-native-sdk architecture.

  • New Hook: useCafFaceLiveness: Introduces a convenient React hook for applying and triggering face liveness flows with configuration support.

  • Direct Execution API: The hook exposes applyCafFaceLiveness() to trigger the flow using the latest configuration.

Configuration Enhancements

  • Typed Configuration via CafFaceLivenessConfiguration:

    • Centralized object for configuring the liveness experience

    • Supports nested CafFaceLivenessBuilderConfiguration for advanced control

  • Builder Options Include:

    • authBaseUrl and livenessBaseUrl for proxying and custom endpoints

    • certificates[] for TLS pinning

    • screenCaptureEnabled toggle

    • debugModeEnabled for verbose logs and developer tools

    • Loading screen support via loading

Breaking Changes

  • Legacy Hook and Flow Removed:

    • useFaceLiveness has been removed and replaced with the new useCafFaceLiveness hook.

    • startFaceLiveness() is no longer needed; the flow is now triggered via applyCafFaceLiveness() inside the hook.

  • Configuration Object Renamed and Simplified:

    • FaceLivenessSettings ➜ replaced by CafFaceLivenessConfiguration, which contains a nested CafFaceLivenessBuilderConfiguration for better structure and type safety.

  • Enum Removals and Type Replacements:

    • The following enums have been removed:

      • Stage ➜ no longer required no longer required Filter, Time ➜ no longer required; behavior now handled by configuration structure

      • Error ➜ replaced by standard error and failure structures

    • Related conditional formatting and platform-specific enum transformations have been eliminated.

  • Response Format Simplified:

    • FaceLivenessResponse, FaceLivenessResult, FaceLivenessError, and FaceLivenessFailure ➜ all removed

@caf.io/[email protected]

New Features

  • Modular UI Integration: The Face Liveness UI module is now available as a standalone package designed to work independently or as part of the new @caf.io/react-native-sdk architecture.

  • New Hook: useCafFaceLivenessUI: Provides a convenient React hook for applying and triggering the face liveness UI flow with support for custom configurations.

  • Direct Execution API: The hook exposes applyCafFaceLivenessUI() to initialize the native UI flow using the current configuration.

Configuration Enhancements

  • Typed Configuration via CafFaceLivenessUIConfiguration: A centralized object for managing both the functional and UI aspects of the liveness experience.

  • Builder Options Include:

    • authBaseUrl and livenessBaseUrl for custom service endpoints

    • certificates[] for secure TLS communication

    • screenCaptureEnabled and debugModeEnabled flags

    • Loading indicator control via the loading flag

  • Instruction Screen Customization via instructionScreenConfiguration:

    • Support for an instructional image, title, description, and ordered step messages

    • Customizable button label to guide users into the flow

@caf.io/[email protected]

New Features

  • Modular SDK Integration: The Document Detector module is now available as a standalone package for modular usage within the @caf.io/react-native-sdk architecture.

  • New Hook: useCafDocumentDetector: React hook that allows initializing the document detection flow by serializing and applying configuration through applyCafDocumentDetector().

Configuration Enhancements

  • Typed Configuration via CafDocumentDetectorConfiguration: Centralized and type-safe configuration using the CafDocumentDetectorBuilderConfiguration interface.

  • Advanced Flow Composition with flow: Define the capture sequence using CafDocumentDetectorFlow[], supporting various documents like RG, CNH, Passport, and more.

  • Expanded Upload Configuration:

    • Control allowed formats (PNG, JPG, PDF, HEIC, etc.)

    • File compression and size limits

    • Full proxy support with authentication options

  • UI and Behavior Customization:

    • Custom preview screen text and layout

    • Document upload messages and assets

    • Step-by-step guidance and instruction labels

    • Timeout, manual capture, popup, and security settings

  • Message Customization Support: Fine-tune user feedback during the capture process with CafDocumentDetectorMessageCustomization.

  • Security Features: Configure development flags (useDevelopmentMode, useAdb, useDebug) for controlled testing environments.

  • Country Restrictions for Passports: Restrict accepted passport documents using allowedPassportCountryList based on ISO 3166-1 alpha-3 codes.

Breaking Changes

  • Legacy Hook and Flow Removed:

    • useDocumentDetector has been removed and replaced with the new useCafDocumentDetector hook.

    • startDocumentDetector() is no longer needed; flow execution now occurs through applyCafDocumentDetector() inside the hook.

  • Configuration Object Renamed and Restructured:

    • DocumentDetectorSettings ➜ replaced by CafDocumentDetectorConfiguration, which wraps a structured CafDocumentDetectorBuilderConfiguration.

  • Step Configuration:

    • DocumentDetectorStep[] ➜ replaced by CafDocumentDetectorFlow[] for defining document capture steps.

  • Message Customization:

    • DocumentDetectorMessageSettings ➜ replaced by CafDocumentDetectorMessageCustomization.

  • Preview Settings:

    • DocumentDetectorPreviewSettings ➜ replaced by CafDocumentDetectorPreviewCustomization.

  • Upload Settings:

    • DocumentDetectorUploadSettings ➜ renamed to CafDocumentDetectorUploadSettings.

  • Proxy Settings:

    • DocumentDetectorProxySettings ➜ replaced by CafDocumentDetectorProxySettings with equivalent structure but new type.

  • Security Settings:

    • DocumentDetectorSecuritySettings ➜ replaced by CafDocumentDetectorSecuritySettings.

  • Sensor Configuration:

    • DocumentDetectorSensorSettings ➜ no longer present as a standalone object.

  • Country Restriction:

    • allowedPassportList used CountryCodes enum ➜ now uses CafCountryCodes.

  • Enum Restructuring:

    • Enums like Stage, Resolution, CaptureMode, and Error were removed. Their behavior has been replaced by structured properties inside configuration objects or removed entirely for simplification.

  • Response Format Simplified:

    • DocumentDetectorResponse, DocumentDetectorResult, and DocumentDetectorError ➜ no longer used. The module now returns its success/failure through the centralized response flow inside the SDK or is handled directly via native integration feedback.

@caf.io/[email protected]

New Features

  • Modular UI Integration: The Document Detector UI module is now available as a standalone package designed to work independently or as part of the new @caf.io/react-native-sdk architecture.

  • New Hook: useCafDocumentDetectorUI: Provides a React hook to apply and trigger the document detection UI flow with a clean and declarative interface.

  • Direct Execution API: The hook exposes applyCafDocumentDetectorUI() to initialize the native document detector UI flow using the latest configuration.

Configuration Enhancements

  • Typed Configuration via CafDocumentDetectorUIConfiguration: Centralized configuration combining core workflow, instructional screens, and document selection steps.

  • Builder Options Include:

    • flow setup with CafDocumentDetectorFlow[] to define document capture steps

    • Upload control via uploadSettings, including file size, compression, and format options

    • Proxy setup with optional authentication via proxySettings

    • Security flags for debugging and testing via securitySettings

    • Manual capture toggles, preview screen control, and timeout customization

  • Instruction Screen Customization via instructionScreenConfiguration:

    • Define images, titles, button labels, and instructional messages for both capture and upload phases

    • Enhance user guidance with detailed step-by-step visuals and descriptions

  • Document Selection UI via documentSelectionScreenConfiguration:

    • Optional screen allowing users to choose the document type before capture begins

    • Customizable title and description to match your app's tone and user flow

@caf.io/[email protected]

New Features

  • Introducing @caf.io/react-native-sdk: A unified SDK for integrating both Face Liveness and Document Detector modules in React Native applications

  • Builder Pattern Support: Simplified setup using CafSdkBuilderConfiguration, allowing type-safe configuration and modular composition

  • Unified Configuration Model: Manage execution order (presentationOrder), UI theming (CafColorConfiguration), and flow behavior in a centralized way

  • Consistent Module Handling: Shared authentication, environment (CafEnvironment), logging (CafLog), and response structure across all modules

  • Simplified Integration: React hook for initializing and managing the full SDK lifecycle

  • Live State Tracking: Provides a unified response object with real-time updates on loading, cancellation, success, failure, and logs

  • Manual Triggering: Exposes initialize() to start the flow after native configuration is complete

  • Built-in Event Management: Listens and reacts to all CafUnifiedEvent emissions, abstracting the native communication layer

Runtime and Response Handling

  • Unified Response Interface: CafResponse includes structured result types:

    • success using CafSuccessResponse

    • failure using CafFailureResponse

    • log, loading, cancelled, and error states

  • Strongly Typed Module Responses:

    • CafDocumentDetectorResult

    • CafFaceLivenessResult

Module Support

  • Supported modules through CafModuleType enum:

    • DOCUMENT_DETECTOR

    • DOCUMENT_DETECTOR_UI

    • FACE_LIVENESS

    • FACE_LIVENESS_UI

Configuration Enhancements

  • Flexible UI Customization:

    • Color theming via CafColorConfiguration

    • Custom confirmation step content via CafConfirmationNextStepContentConfiguration

  • Failure & Logging Support:

    • Enum-based failure types (CafFailureType)

    • Structured logs with log levels (CafLogLevel)

Breaking Changes

  • New Integration Module: @caf.io/react-native-sdk replaces any previous isolated implementations

Last updated