Skip to main content

The OcrOptions object

startOcr parameters

ParameterTypePurposeRequired
environmentCaaSEnvironmentEnum used to set the execution environment to sandbox or production.Yes.
mobileTokenStringThe 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.
documentCaaSDocumentTypeEnum defining the document capture flow performed by the user.Yes.
optionsOcrOptions?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.

ParameterTypePurposeDefault
sessionIdString?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.
fontColorString?Font and icon color of the SDK screens, in hexadecimal format (e.g. "#FFFFFF")."#000000"
backgroundColorString?Background color of the SDK screens, in hexadecimal format (e.g. "#000000")."#FFFFFF"
fontFamilyCaaSFontFamily?Font used on the SDK screens.CaaSFontFamily.openSans
showIntroductionScreensbool?When false, disables the introduction screens shown before the document capture.true
showSuccessScreenbool?When false, disables the success screen shown after the capture.true
audioConfigurationFaceReconAudioConfiguration?Configures the spoken voice guidance, which narrates the capture instructions in real time.FaceReconAudioConfiguration.disable
onboardingTextConfigurationOnboardingTextConfiguration?Customizes the onboarding screen texts.SDK default texts.
logLevelCaaSLogLevel?Verbosity level of the SDK logs.CaaSLogLevel.debug
Warning

The audioConfiguration parameter in OcrOptions is available from plugin version 5.3.0 onwards.

OnboardingTextConfiguration

ParameterTypePurpose
onboardingTitleString?Onboarding screen title.
onboardingFirstLabelString?First instruction shown to the user.
onboardingSecondLabelString?Second instruction shown to the user.
onboardingThirdLabelString?Third instruction shown to the user.
OnboardingTextConfiguration(
onboardingTitle: 'Important tips',
onboardingFirstLabel: 'Go to a well-lit place',
onboardingSecondLabel: 'Remove the document from plastic',
onboardingThirdLabel: 'Make sure the document is properly framed',
)

Enums

CaaSEnvironment

enum CaaSEnvironment {
production,
sandbox,
}

CaaSDocumentType

enum CaaSDocumentType {
cnhFull, // Full Brazilian CNH capture, in a single photo
cnhDigital, // Digital Brazilian CNH PDF
cnh, // Brazilian CNH, front and back
rg, // Brazilian RG, front and back
address, // Proof of address
rne, // Brazilian National Registry of Foreigners, front and back
crnm, // Brazilian National Registry of Migration, front and back
rgCinDigital, // Digital RG/CIN PDF
}
Warning

The rgCinDigital type is available from plugin version 5.3.0 onwards.

CaaSFontFamily

enum CaaSFontFamily {
jakarta, // iOS only
futura, // iOS and Android
verdana, // iOS and Android
trebuchetMs, // iOS only
tamilsangamMn, // iOS only
openSans, // iOS and Android
helvetica, // Android only
poppins, // Android only
roboto, // Android only
systemFont, // 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 openSans.

FaceReconAudioConfiguration

enum FaceReconAudioConfiguration {
enable, // shows the audio toggle, with narration starting off
disable, // disables narration and hides the toggle
accessibility, // shows the toggle with narration starting on when accessibility features are active
}

CaaSLogLevel

enum CaaSLogLevel {
trace,
debug,
log,
info,
warn,
error,
}