The OcrOptions object
startOcr parameters
| Parameter | Type | Purpose | Required |
|---|---|---|---|
| environment | CaaSEnvironment | Enum used to set the execution environment to sandbox or production. | Yes. |
| mobileToken | 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 | CaaSDocumentType | 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.
| Parameter | Type | Purpose | Default |
|---|---|---|---|
| sessionId | 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. |
| fontColor | String? | Font and icon color of the SDK screens, in hexadecimal format (e.g. "#FFFFFF"). | "#000000" |
| backgroundColor | String? | Background color of the SDK screens, in hexadecimal format (e.g. "#000000"). | "#FFFFFF" |
| fontFamily | CaaSFontFamily? | Font used on the SDK screens. | CaaSFontFamily.openSans |
| showIntroductionScreens | bool? | When false, disables the introduction screens shown before the document capture. | true |
| showSuccessScreen | bool? | When false, disables the success screen shown after the capture. | true |
| audioConfiguration | FaceReconAudioConfiguration? | Configures the spoken voice guidance, which narrates the capture instructions in real time. | FaceReconAudioConfiguration.disable |
| onboardingTextConfiguration | OnboardingTextConfiguration? | Customizes the onboarding screen texts. | SDK default texts. |
| logLevel | CaaSLogLevel? | Verbosity level of the SDK logs. | CaaSLogLevel.debug |
Warning
The audioConfiguration parameter in OcrOptions is available from plugin version 5.3.0 onwards.
OnboardingTextConfiguration
| Parameter | Type | Purpose |
|---|---|---|
| onboardingTitle | String? | Onboarding screen title. |
| onboardingFirstLabel | String? | First instruction shown to the user. |
| onboardingSecondLabel | String? | Second instruction shown to the user. |
| onboardingThirdLabel | String? | 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,
}