Document Smart Capture
Install and launch Smart Capture for React Native. Learn configuration options, event handling, and result handling.
Overview
Smart Capture is a rebuilt, more intelligent document capture experience. Instead of telling the SDK which document type and side to expect at each step, you just declare which document types your app accepts (acceptedDocuments) — the user captures and/or uploads a document photo (depending on the validationType you configure — camera capture, gallery/file upload, or both), and Smart Capture identifies the document type and side on its own and validates it against that list. It also detects on its own whether a document is single-page (FULL) or two-sided (FRONT/BACK), prompting for the second side only when needed. It also includes optional auto capture and preview, and uses the same Certta session as Face Liveness and Document Detector: configure your credentials once with useCerttaSdk().configureSDK(...), then open the capture UI with useCerttaSmartCapture().open(...).
Prerequisites
Before proceeding, ensure the Certta React Native SDK is properly installed. If you haven't done this yet, please refer to our Installation Guide.
Dependencies
Smart Capture is enabled from caf-modules-config.json at the app root (the file CocoaPods and Gradle read when you install native deps). You do not add Gradle artifacts or CocoaPods by hand — the plugin pulls them from this config.
{
"modules": {
"smartCapture": {
"enabled": true,
"autoCapture": false
}
}
}modules.smartCapture.enabled
Required
Smart Capture bridge (Android and iOS) and the useCerttaSmartCapture hook.
modules.smartCapture.autoCapture
Optional
Android LiteRT auto capture provider. Needed for enableAutoCapture to actually do anything on Android.
Starting Smart Capture
To start the Smart Capture flow, call open() from useCerttaSmartCapture() and pass a CerttaSmartCaptureConfiguration object. Results arrive on the hook's event (success / error).
CerttaSmartCaptureConfiguration parameters
All parameters except acceptedDocuments have defaults; override only what you need.
acceptedDocuments
CerttaAcceptedDocumentType[]
None
Document types permitted for capture or upload. Required — Smart Capture fails at open() if empty.
showInstructions
boolean
true
Shows instructional screens before any capture/upload.
enablePreview
boolean
true
Shows a preview of the captured image for user confirmation before sending.
enableAutoCapture
boolean
true
Requests automatic capture when alignment criteria are met. On Android, requires modules.smartCapture.autoCapture: true; falls back to manual capture if absent.
skipSuccessScreen
boolean
false
Skips the success screen shown after a successful capture/upload.
validationType
CerttaValidationType
CAPTURE_AND_UPLOAD
Which flows are allowed: CAPTURE, UPLOAD, or CAPTURE_AND_UPLOAD.
allowedUploadTypes
CerttaFileAcceptedType[]
all values
File formats accepted from gallery/files (JPEG, PNG, PDF, HEIF, HEIC). An empty array is treated as all types.
CerttaAcceptedDocumentType
DRIVER_LICENSE
CNH
IDENTITY_CARD
RG, CIN
RESIDENCE_IDENTITY_CARD
RNM, RNE
EMPLOYMENT_CARD
CTPS
VEHICLE_LICENSE
CRLV
PASSPORT
Passport
ANY
Any document type
Behavior and limits
Accepted documents are required.
acceptedDocumentsmust contain at least one value. An empty array dismisses the flow before the camera or the capture provider starts.One flow at a time. Only one Smart Capture flow may run per process. Starting a second one while the first is active fails with a message stating that a capture session is already in progress.
Upload file size. Files larger than 10 MB are rejected. This limit is not configurable.
Upload file count. The upload path accepts either one file containing the whole document or two files for front and back.
Understanding Smart Capture events and results
The hook listens to SmartCaptureEvent.Success and SmartCaptureEvent.Error and exposes them as event.success and event.error.
Success — CerttaSuccess
response is a signed JWT/string containing the server-side validation results and document metadata. Your backend or Certta integration documentation defines how to validate, decode, and store it.
Error — CerttaError
InitializationError
Session not configured or invalid config (e.g. empty acceptedDocuments).
PermissionError
Missing runtime permission (e.g. camera).
SecurityError
Security validation failed (when securityEnabled is active on the Certta session).
NetworkError
Network/request failure.
UnknownError
Unexpected/unmapped failure.
Cancelled
The user dismissed the flow.
Subpages
Text CustomizationColor CustomizationImage CustomizationAtualizado

