Skip to main content

The OcrOptions object

startOcr parameters

ParameterTypePurposeRequired
environmentCAAS_ENVIRONMENTEnum used to set the execution environment to SANDBOX or PRODUCTION.Yes.
mobile_tokenstringThe client key identifying that the collected data comes from your application. If you have not received your mobile-token yet, contact support. Each environment requires a different token.Yes.
documentCAAS_DOCUMENT_TYPEEnum defining the document capture flow performed by the user.Yes.
optionsOcrOptionsOptional object with the SDK's visual, textual and behavioral customizations.No.

OcrOptions

All fields are optional. When a field is not provided, the native SDK applies its default value.

type OcrOptions = {
session_id?: string;
font_color?: string;
background_color?: string;
font_family?: CAAS_FONT_FAMILY;
show_introduction_screens?: boolean;
show_success_screen?: boolean;
onboarding_text_configuration?: OnboardingTextConfiguration;
log_level?: CAAS_LOG_LEVEL;
audio_configuration?: FACE_RECON_AUDIO_CONFIGURATION;
};
ParameterTypePurposeDefault
session_idstringKey identifying the session started in the SDK. It is used to trace the entire flow taken by the user through logs. Accepts up to 255 characters.Generated internally.
font_colorstringFont and icon color of the SDK screens, in hexadecimal format (e.g. "#FFFFFF")."#000000"
background_colorstringBackground color of the SDK screens, in hexadecimal format (e.g. "#000000")."#FFFFFF"
font_familyCAAS_FONT_FAMILYFont used on the SDK screens.CAAS_FONT_FAMILY.OPEN_SANS
show_introduction_screensbooleanWhen false, disables the introduction screens shown before the document capture.true
show_success_screenbooleanWhen false, disables the success screen shown after the capture.true
onboarding_text_configurationOnboardingTextConfigurationCustomizes the onboarding screen texts.SDK default texts.
log_levelCAAS_LOG_LEVELVerbosity level of the SDK logs.CAAS_LOG_LEVEL.DEBUG
audio_configurationFACE_RECON_AUDIO_CONFIGURATIONConfigures the spoken voice guidance, which narrates the capture instructions in real time.FACE_RECON_AUDIO_CONFIGURATION.DISABLE

OnboardingTextConfiguration

type OnboardingTextConfiguration = {
onboarding_title?: string;
onboarding_first_label?: string;
onboarding_second_label?: string;
onboarding_third_label?: string;
};
ParameterTypePurpose
onboarding_titlestringOnboarding screen title.
onboarding_first_labelstringFirst instruction shown to the user.
onboarding_second_labelstringSecond instruction shown to the user.
onboarding_third_labelstringThird instruction shown to the user.

Enums

CAAS_ENVIRONMENT

enum CAAS_ENVIRONMENT {
PRODUCTION = 'production',
SANDBOX = 'sandbox',
}

CAAS_DOCUMENT_TYPE

enum CAAS_DOCUMENT_TYPE {
CNH_FULL = 'cnh_full', // Full Brazilian CNH capture, in a single photo
CNH_DIGITAL = 'cnh_digital', // Digital Brazilian CNH PDF
CNH = 'cnh', // Brazilian CNH, front and back
RG = 'rg', // Brazilian RG, front and back
ADDRESS = 'proof_of_address', // Proof of address
RNE = 'rne', // Brazilian National Registry of Foreigners, front and back
CRNM = 'crnm', // Brazilian National Registry of Migration, front and back
RG_CIN_DIGITAL = 'rg_cin_digital', // Digital RG/CIN PDF
}

CAAS_FONT_FAMILY

enum CAAS_FONT_FAMILY {
JAKARTA = 'jakarta', // iOS only
FUTURA = 'futura', // iOS and Android
VERDANA = 'verdana', // iOS and Android
TREBUCHET_MS = 'trebuchetms', // iOS only
TAMILSANGAM_MN = 'tamilsangammn', // iOS only
OPEN_SANS = 'open_sans', // iOS and Android
HELVETICA = 'helvetica', // Android only
POPPINS = 'poppins', // Android only
ROBOTO = 'roboto', // Android only
SYSTEM_FONT = 'system_font', // iOS only
}
Warning

Font availability varies by platform. If an unsupported font is passed, the platform's default font is used. For cross-platform consistency, use FUTURA, VERDANA or OPEN_SANS.

FACE_RECON_AUDIO_CONFIGURATION

enum FACE_RECON_AUDIO_CONFIGURATION {
ENABLE = 'enable', // shows the audio toggle, with narration starting off
DISABLE = 'disable', // disables narration and hides the toggle
ACCESSIBILITY = 'accessibility', // shows the toggle with narration starting on when accessibility features are active
}

CAAS_LOG_LEVEL

enum CAAS_LOG_LEVEL {
TRACE = 'trace',
DEBUG = 'debug',
LOG = 'log',
INFO = 'info',
WARN = 'warn',
ERROR = 'error',
}