TypeScript References

Types

DocumentDetectorResponse

FieldTypeDescription

result

Shows when document detector returns a successful capture.

error

Shows when the document detector return some error.

cancelled

boolean

Shows when user cancel the document detector.

DocumentDetectorResult

FieldTypeDescription

captures

The array with the respective captures of the parameterized documents

trackingId

string

Identifier of this run on our servers. If possible, save this field and send it along to our API. This way we will have more data about how the user behaved during the execution

type

string

The class of the read document stream. This parameter is useful in an integration with our OCR route. The existing types are: ["blank", "cnh", "cnh_new", "generic", "rg", "rg_new", "rne", "rnm", "ctps", "passport, crlv, crlv_new"]

DocumentDetectorError

FieldTypeDescription

statusCode

string

Https code status.

message

string

Detailed error message.

error

Enum describing the type of error.

DocumentDetectorSettings

FieldTypeDescriptionAndroidiOSRequerid

documentSteps

Defines the document capture flow.

captureStages

Configures the requirements for each capture stage. Designed to make capture more flexible in cases where the user is unable to capture with all checks active, preventing them from getting stuck at this stage in their registration flow.

cafStage

Change the development environment.

popupSettings

boolean

Enables/disables the popups displayed before each document capture.

networkSettings

number

Defines SDK's requests timeout.

sensorSettings

Object of the configuration for define the sensors of the SDK.

proxySettings

Defines your proxy to make requests.

previewSettings

Enables/disables and allows the configuration of the visualization of the capture performed, requesting the user's confirmation to proceed.

compressSettings

number

Allows you to configure the quality in the compression process. By default, all captures go through compression. The method expects values between 80 and 100 as a parameter, where 100 is the best quality compression.

manualCaptureSettings

number

Enables/disables manual capture.

imageUrlExpireTime

string

Sets the time the image URL will last on the server until it is expired. Expect to receive a time interval between "30m" to "30d". Examples: "30m": To set minutes only "24h": To set only hour(s). "1h 10m": To set hour(s) and minute(s). "10d": To set day(s).

currentStepDoneDelay

number

Delays the activity after the completion of each step.

resolutionSettings

Allows you to set the capture resolution.

allowedPassportList

Enables the option to allow passports from only a certain issuing country, or, a list of countries.

messageSettings

To custom messages use this object.

uploadSettings

To enable the document upload functionality it is necessary to use this object.

style

Defines the primary color and feedback colors of the SDK.

securitySettings

The SDK has some blocks that may prevent its execution in certain contexts. To disable them, you can use the methods as shown in the example below.

DocumentDetectorStep

FieldTypeDescriptionAndroidiOS

document

Defines the document capture flow.

stepLabel

string

Defines text to be shown in the lower part of the layout.

showStepLabel

boolean

Present the text to be displayed at the top of the layout.

illustration

string

Defines illustration to be shown in the popup prior to capture.

DocumentDetectorCaptureStage

FieldTypeDescriptionAndroidiOS

captureMode

Defines the capture mode.

durationMillis

number

Duration of the stage, in milliseconds.

wantSensorCheck

boolean

Enables/Disables the use of sensors for capturing the photo.

DocumentDetectorSensorSettings

FieldTypeDescriptionAndroidiOS

luminositySensor

number

Defines threshold between acceptable/unacceptable ambient brightness.

orientationSensor

number

Defines threshold between correct/incorrect device orientation. Higher the value more flexible it will be.

stabilitySensor

Changes the default settings of the stability sensor. The threshold of this sensor is in the range of the last two accelerations collected from the device.

DocumentDetectorSensorSettingsStabilitySensor

FieldTypeDescriptionAndroidiOS

stabledMillis

number

Defines stability sensor settings.

threshold

number

The threshold of this sensor is in the range of the last two accelerations collected from the device.

DocumentDetectorProxySettings

FieldTypeDescriptionAndroidiOS

hostname

string

Sets the domain or IP address of the proxy service.

port

number

Sets the port to be used.

authentication

Enables/Disables the use of sensors for capturing the photo.

DocumentDetectorProxySettingsAuthentication

FieldTypeDescriptionAndroidiOS

user

string

Username to be used for authentication.

password

number

Password to be used for authentication.

DocumentDetectorPreviewSettings

FieldTypeDescriptionAndroidiOS

show

boolean

Enables/disables and allows the configuration of the visualization of the capture performed, requesting the user's confirmation to proceed.

title

string

Sets the title shown on the screen.

subtitle

string

Sets the subtitle displayed on the screen.

confirmLabel

string

Sets the message displayed on the confirmation button.

retryLabel

string

Sets the message displayed on the button to perform a new capture.

DocumentDetectorMessageSettings

FieldTypeDescriptionAndroidiOS

waitMessage

string

Message displayed when you start the camera

fitTheDocumentMessage

string

Message telling you to fit the document to the mask

holdItMessage

string

Message displayed at the moment the capture is being performed

verifyingQualityMessage

string

Message displayed when the SDK makes a request to the backend, checking for quality

lowQualityDocumentMessage

string

Message displayed when the capture quality fails

uploadingImageMessage

string

Message displayed when there is no quality check and the capture is being saved on the servers

openDocumentWrongMessage

string

Message displayed when displaying an open document, the message will be displayed together with the error message on the document being used, example: if the user displays an open CNH(Brazilian drive’s license), the standard error message "Essa é uma CNH Aberta" + the defined message will be displayed.

popupDocumentSubtitleMessage

string

Message displayed in the subtitle of the pop-up that brings the illustration of the document that is being requested for capture.

wrongDocumentMessage

string

Message displayed when the document is displayed in a different stream than expected.

unsupportedDocumentMessage

string

Message displayed when a unexpected type of document is displayed for capture

documentNotFoundMessage

string

Message displayed when a document is unknown

sensorLuminosityMessage

string

Message displayed when the brightness threshold is lower than expected

sensorOrientationMessage

string

Message displayed when the orientation threshold is lower than expected

sensorStabilityMessage

string

Message displayed when the orientation threshold is lower than expected

positiveButtonMessage

string

Allows for customization of the confirmation button message

predictorScanDocumentMessage

string

Message displayed to request a document to be present on the camera.

predictorGetCloserMessage

string

Message displayed to request to get closer to the document.

predictorCentralizeMessage

string

Message displayed to request to center the document.

predictorMoveAwayMessage

string

Message displayed to request to move away from the document.

predictorAlignDocumentMessage

string

Message displayed to request to align the document.

predictorTurnDocumentMessage

string

Message displayed to request to turn document 90 degrees.

predictorCapturedMessage

string

Message displayed to alert that the document was captured.

DocumentDetectorUploadSettings

FieldTypeDescriptionAndroidiOS

enable

boolean

Enables/disables this feature.

compress

boolean

Enables/disables file compression before uploading.

fileFormats

Defines the file format(s) that will be accepted for upload.

maxFileSize

number

Sets the maximum KB limit of the file to upload.

DocumentDetectorStyle

FieldTypeDescriptionAndroidiOS

primaryColor

string

Define the principal color of the SDK.

Use hexadecimal colors. Example: #34d690

feedbackColors

Colors of the feedback area.

Use hexadecimal colors. Example: #34d690.

DocumentFeedbackColors

FieldTypeDescriptionAndroidiOS

defaultColor

string

Defines the default coolor for default feedback.

errorColor

string

defines the error color when there is an error capturing the document.

successColor

string

Sets the success color when the document is captured.

DocumentDetectorSecuritySettings

FieldTypeDescriptionAndroidiOS

useEmulator

boolean

Enables the use of emulator.

useRoot

boolean

Enables the use of rooted devices.

useDevelopmentMode

boolean

Enable developer mode on the physical device.

useAdb

boolean

Enable the Android Debug Bridge (ADB).

useDebug

boolean

Enable debug mode for Android.

Enums

Document

FieldDescriptionAndroidiOS

RG_FRONT

Front of the RG, part where the photo is.

RG_BACK

Back of the RG, where the data is.

RG_FULL

RG open, showing both the front and back.

CNH_FRONT

Front of the CNH, part where the photo is.

CNH_BACK

Back of the CNH, part where the signature is.

CNH_FULL

CNH open, showing both the front and back.

CRLV

CRLV.

RNE_FRONT

Front of RNE and RNM, where are the data.

RNE_BACK

Back of RNE and RNM, where is the photo.

PASSPORT

Passport, one side only, showing all data.

CTPS_FRONT

Front of CTPS, where the photo is located.

CTPS_BACK

Back of the CTPS, where it contains the data.

OTHERS

Other identification documents in general, such as RNE, Military Identity, OAB and CRLV.

ANY

Allows the sending of any type of document, all those mentioned above, including any other document, as no typifications are made.

CaptureMode

FieldDescriptionAndroidiOS

AUTOMATIC

Automatically scans the document.

MANUAL

Scan the document manually.

Stage

FieldDescriptionAndroidiOS

BETA

Beta environment.

PROD

Production environment.

Resolution

FieldDescriptionAndroidiOS

FULL_HD

1920 x 1080

QUAD_HD

2560 x 1440

ULTRA_HD

3840 x 2160

CountryCodes

See the complete list at: ISO 3166-1 alpha-3. Example: CountryCodes.BRA.

FileFormat

FieldDescriptionAndroidiOS

PNG

image/png

JPG

image/jpg

JPEG

image/jpeg

PDF

image/pdf

HEIF

image/heif

Error

FieldDescriptionAndroidiOS

PermissionReason

You are missing some mandatory permission to run the SDK.

NetworkReason

Indicates a network-related exception occurred during verification.

ServerReason

Indicates a server-side exception occurred during verification.

InvalidTokenReason

Indicates an issue with the token used for verification.

SecurityReason

When the SDK cannot be started due to a security reason.

StorageReason

When an SDK internal library cannot be started.

LibraryReason

There is no space on the user device's internal storage.

UnexpectedReason

An unxpected error has occurred.

Last updated

Logo

2023 © Caf. - All rights reserved