The OcrOptions object
startOcr parameters
| Parameter | Type | Purpose | Required |
|---|---|---|---|
| environment | CAAS_ENVIRONMENT | Enum used to set the execution environment to SANDBOX or PRODUCTION. | Yes. |
| mobile_token | string | The 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. |
| document | CAAS_DOCUMENT_TYPE | Enum defining the document capture flow performed by the user. | Yes. |
| options | OcrOptions | Optional 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;
};
| Parameter | Type | Purpose | Default |
|---|---|---|---|
| session_id | string | Key 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_color | string | Font and icon color of the SDK screens, in hexadecimal format (e.g. "#FFFFFF"). | "#000000" |
| background_color | string | Background color of the SDK screens, in hexadecimal format (e.g. "#000000"). | "#FFFFFF" |
| font_family | CAAS_FONT_FAMILY | Font used on the SDK screens. | CAAS_FONT_FAMILY.OPEN_SANS |
| show_introduction_screens | boolean | When false, disables the introduction screens shown before the document capture. | true |
| show_success_screen | boolean | When false, disables the success screen shown after the capture. | true |
| onboarding_text_configuration | OnboardingTextConfiguration | Customizes the onboarding screen texts. | SDK default texts. |
| log_level | CAAS_LOG_LEVEL | Verbosity level of the SDK logs. | CAAS_LOG_LEVEL.DEBUG |
| audio_configuration | FACE_RECON_AUDIO_CONFIGURATION | Configures 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;
};
| Parameter | Type | Purpose |
|---|---|---|
| onboarding_title | string | Onboarding screen title. |
| onboarding_first_label | string | First instruction shown to the user. |
| onboarding_second_label | string | Second instruction shown to the user. |
| onboarding_third_label | string | Third 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',
}