Skip to main content

Configuration Options

The SDK accepts a configuration object during initialization with the following options:

Core Settings

OptionTypeDefaultDescription
lensFlavorstringRequiredDetermines scanning experience type:
- 'document': Receipts & Invoices scanning
- 'long_document': Long Receipts scanning
- 'credit_card': Credit card scanning
- 'checks': Check scanning (front/back)
- 'upload': File upload only
containerstringundefinedHTML element ID where lens will mount. Creates full-screen overlay if not specified
debug_modebooleanfalseEnables debug logging to console

Document Processing

OptionTypeDefaultDescription
detectScreenCapturebooleanfalseEnables detection of screen capture attempts
enforceBothSidesbooleanfalseEnforces capture of both sides of documents
enforceAndSkipBothSidesbooleanfalseEnforces both sides capture but skips the dialog
delayBetweenCapturesnumber0Delay in milliseconds between front and back capture
enforceDocumentDetectionbooleanfalseForces document detection validation
enforceBlurDetectionbooleanfalseForces blur detection validation

UI Elements

OptionTypeDefaultDescription
torchButtonbooleanfalseAdds flashlight toggle button (requires device support)
exitButtonbooleanfalseAdds button to close camera view
blurModalbooleanfalseShows warning when blur detected
isDocumentModalbooleanfalseShows warning when no document detected
enableSubmitbooleantrueShows submit button after successful capture

Special Features

OptionTypeDefaultDescription
captureBackOfCheckbooleanfalseEnables back side capture for checks (requires lensFlavor: 'checks')
enableLongReceiptPreviewbooleanfalseShows preview during receipt stitching (requires lensFlavor: 'long_document')

Text Customization

OptionTypeDefaultDescription
documentModalMessagestring'Oops, There appears to be no document on your image'Custom message for document detection modal
blurModalMessagestring'Oops, The image is too blurry to process'Custom message for blur detection modal
submitButtonTextstring'Submit Anyway'Custom text for submit button
retakeButtonTextstring'Retake a picture'Custom text for retake button
cropButtonTextstring'Crop'Custom text for crop button
resetButtonTextstring'Reset'Custom text for reset button
dropZoneTextstring'Click or drag and drop to upload an image'Custom text for upload drop zone (requires lensFlavor: 'upload')
checkEnforcedModalMessagestring'Please flip the check and capture the back side'Custom message when back check capture is required (requires lensFlavor: 'checks' and enforceBothSides: true)
checkOptionalModalMessagestring'Do you want to capture the back side of the check?'Custom message when back check capture is optional (requires lensFlavor: 'checks' and captureBackOfCheck: true)
checkContinueButtonTextstring'Continue'Custom text for check continue button (requires lensFlavor: 'checks' and enforceBothSides: true)
checkYesButtonTextstring'Yes'Custom text for check confirmation button (requires lensFlavor: 'checks')
checkNoButtonTextstring'No'Custom text for check rejection button (requires lensFlavor: 'checks')
OptionTypeDefaultDescription
onCloseRedirectUrlstringundefinedURL to redirect to when exit pressed
onClosefunctionundefinedCallback when camera view closes:
(isVisible: boolean) => void

Usage Example

await VeryfiLens.init("YOUR_CLIENT_ID", {
lensFlavor: "document",
statusIndicator: true,
torchButton: true,
exitButton: true,
debug_mode: true,
documentModalMessage: "Please ensure a document is visible in the frame",
blurModalMessage: "Image is too blurry, please try again",
submitButtonText: "Process Document",
retakeButtonText: "Capture Again"
});

Dynamic Configuration

You can update configuration during runtime:

info

All settings except lensFlavor and container can be updated during runtime.

VeryfiLens.configureLens({
blurModal: false,
torchButton: false
});