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
CafDocumentDetectorFlowfor document captureSupport 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
React Native Version
0.73.x
Node.js
18
Android
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
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.
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.
If you include the PayFace provider, you must also use iProov Lite (iproov-lite). PayFace is built against Protobuf JavaLite; mixing it with iproov-full causes Protobuf dependency conflicts at build time.
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 installwhenever 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
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
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:
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:
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:
Ensure the JWT response is evaluated on the backend. This process must include validating the token's signature and verifying the isAlive and isMatch fields. Do not perform these validations on the client side.
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. ReturnsPromise<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 theinitializefunction successfully applied all module configurations. This state can be used to verify that configurations were applied correctly before callingstartSDK().
Ensure the JWT response is evaluated on the backend. This process must include validating the token's signature and verifying the isAlive and isMatch fields. Do not perform these validations on the client side.
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 beforestart()Pre-loading the session helps reduce the initial loading time when
start()is eventually calledThis 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[]objecterror: 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)
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)
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)
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)
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/targetSdk36), 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/targetSdkupdated to 36.
@caf.io/[email protected]
Release date
08-03-2026
Breaking change : The Fingerprint module is now optional and can be configured in caf-modules-config.json via the new fingerprint property (boolean). By default, fingerprint is set to false, meaning you do not need to add this property to the JSON unless you want to use it. To enable the module, you must explicitly add "fingerprint": true. Important: Fingerprint must also be enabled on Backoffice. If it is not enabled on Backoffice, the SDK will never call the fingerprint library and no data will be sent, even if the property is set to true locally.
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
fingerprintboolean field incaf-modules-config.jsonfor 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:
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
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 theresponseobject (success,failure,error,cancelled,log,loading) at the start of every call.The
Success,Failure,Error, andCancelledevents now all setinitializedback tofalse.The
LoadingandLoadedevents no longer clearsuccess/failure/error/cancelled— they only update theloadingflag.
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(defaulttrue) onCafFaceLivenessUIInstructionScreenConfiguration, 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.2to1.19.2.Payface Liveness Provider (iOS): Update version from
1.5.2to1.8.2.
Fixes
FaceLiveness
Infinite loading error occurs when the SDK returns an error.
First initialization not working when using
Payfaceprovider.
@caf.io/[email protected]
Release date
04-27-2026
Breaking change : Face Liveness providers can now be configured in caf-modules-config.json via livenessProviders (string or array). When provided, it must list the chosen provider(s). Do not use iproov-lite and iproov-full together—iproov-full uses a different version of Protobuf, and combining them will cause duplicate class errors at build time. PayFace requires iproov-lite (Protobuf JavaLite); pairing PayFace with iproov-full causes build-time Protobuf conflicts. If omitted, the SDK defaults to iproov-lite on both platforms. An empty or invalid value causes a build error on Android; on iOS, an empty value also falls back to iproov-lite, but an invalid value causes a build failure. See Step 2: Configure Module Selection for details.
Features
Configurable Face Liveness providers: Choose
iproov-lite,iproov-full,payface, and/orfacetecfromcaf-modules-config.jsoninstead of relying on implicit native defaults.
Updates
Liveness provider configuration:
New
livenessProvidersfield incaf-modules-config.jsonfor Android and iOS.Documented Protobuf JavaLite vs Protobuf Java mapping for
iproov-litevsiproov-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]
Versions earlier than 4.3.0 will result iProov Liveness to become inoperable as of March 12, 2026. To ensure proper functionality and service continuity, please use version 4.3.0 or later.
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_ISSUEDEVICE_ISSUEEYEWEARFACE_NOT_FOUNDFRAMES_BLURRYMOTION_ISSUELIGHTING_ISSUESREJECTEDSYSTEM_ERRORTIMEOUTUSER_NOT_FOUNDDEVICE_RESTARTPROCESSING_FAULT
@caf.io/[email protected]
Release date
02/02/2026
Features
New CafSecurity module: Added a new module with security validations.
New configuration flag:
enableSecurityModuleinCafSdkConfigurationwith default valuetrue
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
payFaceDebugModeinCafFaceLivenessConfigto 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 returnsPromise<boolean>. The callback parameter also returnsPromise<boolean>.applyCafFaceLiveness(): Now returnsPromise<boolean>.applyCafFaceLivenessUI(): Now returnsPromise<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
flowinCafDocumentDetectorConfig: This issue was causing the SDK to close immediately during opening the document capture flow. Now the SDK will emit a new error eventCafErrorType.LIBRARY_EXCEPTIONwith the message "Empty document options".Fixed error when use
loadSessionin 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 errorSEQUENCE_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 whenstart()is called. This method is optional and can be called afterinitialize()but beforestart().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 ofCafSuccessResponseobjects.
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()afterinitialize()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
flowinCafDocumentDetectorConfig: This issue was causing the SDK to close immediately during opening the document capture flow. Now the SDK will emit a new error eventCafErrorType.LIBRARY_EXCEPTIONwith 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-sdkRemove type imports from individual packages
Import all types from
@caf.io/react-native-sdk
Module Configuration: New configuration system using
caf-modules-config.jsonfileModules 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 includeAvailable modules:
documentDetector: Enable/disable Document Detector modulefaceLiveness: Enable/disable Face Liveness moduledocumentDetectorUI: Enable/disable Document Detector UI modulefaceLivenessUI: 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:
Remove old dependencies:
Install the unified SDK:
Create module configuration file: Create
caf-modules-config.jsonin your project root:Update imports:
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:
CafErrorTypeandCafFailureTypeenums added to the SDK
New Properties:
CafSdkBuilderConfigurationnow hasenableTransitionScreensproperty to enable/disable transition screens between modulesCafColorConfigurationnow hasdialogBackgroundColoranddialogBorderColorproperties 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:
CafDocumentDetectorUIBuilderInstructionScreenConfigurationnow hasenableproperty to customize the instruction screen
@caf.io/[email protected]
New Features
Implementation: New
executeFaceAuthproperty in Face Liveness modules for more granular control over face authentication
@caf.io/[email protected]
New Features
New Property:
executeFaceAuthproperty allows for more granular control over the face authentication process
@caf.io/[email protected]
New Features
New Property:
executeFaceAuthproperty 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 applicationsBuilder Pattern Support: Simplified setup using
CafSdkBuilderConfiguration, allowing type-safe configuration and modular compositionUnified Configuration Model: Manage execution order (
presentationOrder), UI theming (CafColorConfiguration), and flow behavior in a centralized wayConsistent Module Handling: Shared authentication, environment (
CafEnvironment), logging (CafLog), and response structure across all modulesSimplified Integration: React hook for initializing and managing the full SDK lifecycle
Live State Tracking: Provides a unified
responseobject with real-time updates on loading, cancellation, success, failure, and logsManual Triggering: Exposes
initialize()to start the flow after native configuration is completeBuilt-in Event Management: Listens and reacts to all
CafUnifiedEventemissions, abstracting the native communication layer
Runtime and Response Handling
Unified Response Interface:
CafResponseincludes structured result types:successusingCafSuccessResponsefailureusingCafFailureResponselog,loading,cancelled, anderrorstates
Strongly Typed Module Responses:
CafDocumentDetectorResultCafFaceLivenessResult
Module Support
Supported modules through
CafModuleTypeenum:DOCUMENT_DETECTORDOCUMENT_DETECTOR_UIFACE_LIVENESSFACE_LIVENESS_UI
Configuration Enhancements
Flexible UI Customization:
Color theming via
CafColorConfigurationCustom 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-sdkreplaces 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-sdkarchitecture.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
CafFaceLivenessBuilderConfigurationfor advanced control
Builder Options Include:
authBaseUrlandlivenessBaseUrlfor proxying and custom endpointscertificates[]for TLS pinningscreenCaptureEnabledtoggledebugModeEnabledfor verbose logs and developer toolsLoading screen support via
loading
Breaking Changes
Legacy Hook and Flow Removed:
useFaceLivenesshas been removed and replaced with the newuseCafFaceLivenesshook.startFaceLiveness()is no longer needed; the flow is now triggered viaapplyCafFaceLiveness()inside the hook.
Configuration Object Renamed and Simplified:
FaceLivenessSettings➜ replaced byCafFaceLivenessConfiguration, which contains a nestedCafFaceLivenessBuilderConfigurationfor better structure and type safety.
Enum Removals and Type Replacements:
The following enums have been removed:
Stage➜ no longer required no longer requiredFilter,Time➜ no longer required; behavior now handled by configuration structureError➜ replaced by standarderrorandfailurestructures
Related conditional formatting and platform-specific enum transformations have been eliminated.
Response Format Simplified:
FaceLivenessResponse,FaceLivenessResult,FaceLivenessError, andFaceLivenessFailure➜ 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-sdkarchitecture.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:
authBaseUrlandlivenessBaseUrlfor custom service endpointscertificates[]for secure TLS communicationscreenCaptureEnabledanddebugModeEnabledflagsLoading indicator control via the
loadingflag
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-sdkarchitecture.New Hook:
useCafDocumentDetector: React hook that allows initializing the document detection flow by serializing and applying configuration throughapplyCafDocumentDetector().
Configuration Enhancements
Typed Configuration via
CafDocumentDetectorConfiguration: Centralized and type-safe configuration using theCafDocumentDetectorBuilderConfigurationinterface.Advanced Flow Composition with
flow: Define the capture sequence usingCafDocumentDetectorFlow[], supporting various documents likeRG,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
allowedPassportCountryListbased on ISO 3166-1 alpha-3 codes.
Breaking Changes
Legacy Hook and Flow Removed:
useDocumentDetectorhas been removed and replaced with the newuseCafDocumentDetectorhook.startDocumentDetector()is no longer needed; flow execution now occurs throughapplyCafDocumentDetector()inside the hook.
Configuration Object Renamed and Restructured:
DocumentDetectorSettings➜ replaced byCafDocumentDetectorConfiguration, which wraps a structuredCafDocumentDetectorBuilderConfiguration.
Step Configuration:
DocumentDetectorStep[]➜ replaced byCafDocumentDetectorFlow[]for defining document capture steps.
Message Customization:
DocumentDetectorMessageSettings➜ replaced byCafDocumentDetectorMessageCustomization.
Preview Settings:
DocumentDetectorPreviewSettings➜ replaced byCafDocumentDetectorPreviewCustomization.
Upload Settings:
DocumentDetectorUploadSettings➜ renamed toCafDocumentDetectorUploadSettings.
Proxy Settings:
DocumentDetectorProxySettings➜ replaced byCafDocumentDetectorProxySettingswith equivalent structure but new type.
Security Settings:
DocumentDetectorSecuritySettings➜ replaced byCafDocumentDetectorSecuritySettings.
Sensor Configuration:
DocumentDetectorSensorSettings➜ no longer present as a standalone object.
Country Restriction:
allowedPassportListusedCountryCodesenum ➜ now usesCafCountryCodes.
Enum Restructuring:
Enums like
Stage,Resolution,CaptureMode, andErrorwere removed. Their behavior has been replaced by structured properties inside configuration objects or removed entirely for simplification.
Response Format Simplified:
DocumentDetectorResponse,DocumentDetectorResult, andDocumentDetectorError➜ 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-sdkarchitecture.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:
flowsetup withCafDocumentDetectorFlow[]to define document capture stepsUpload control via
uploadSettings, including file size, compression, and format optionsProxy setup with optional authentication via
proxySettingsSecurity flags for debugging and testing via
securitySettingsManual 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 applicationsBuilder Pattern Support: Simplified setup using
CafSdkBuilderConfiguration, allowing type-safe configuration and modular compositionUnified Configuration Model: Manage execution order (
presentationOrder), UI theming (CafColorConfiguration), and flow behavior in a centralized wayConsistent Module Handling: Shared authentication, environment (
CafEnvironment), logging (CafLog), and response structure across all modulesSimplified Integration: React hook for initializing and managing the full SDK lifecycle
Live State Tracking: Provides a unified
responseobject with real-time updates on loading, cancellation, success, failure, and logsManual Triggering: Exposes
initialize()to start the flow after native configuration is completeBuilt-in Event Management: Listens and reacts to all
CafUnifiedEventemissions, abstracting the native communication layer
Runtime and Response Handling
Unified Response Interface:
CafResponseincludes structured result types:successusingCafSuccessResponsefailureusingCafFailureResponselog,loading,cancelled, anderrorstates
Strongly Typed Module Responses:
CafDocumentDetectorResultCafFaceLivenessResult
Module Support
Supported modules through
CafModuleTypeenum:DOCUMENT_DETECTORDOCUMENT_DETECTOR_UIFACE_LIVENESSFACE_LIVENESS_UI
Configuration Enhancements
Flexible UI Customization:
Color theming via
CafColorConfigurationCustom 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-sdkreplaces any previous isolated implementations
Last updated

