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
docValidationbooleanfalseEnables document detection validation
detectBlurbooleanfalseEnables blur detection during capture
detectScreenCapturebooleanfalseEnables detection of screen capture attempts

UI Elements

OptionTypeDefaultDescription
torchButtonbooleanfalseAdds flashlight toggle button (requires device support)
exitButtonbooleanfalseAdds button to close camera view
blurModalbooleanfalseShows warning when blur detected (requires detectBlur: true)
isDocumentModalbooleanfalseShows warning when no document detected (requires docValidation: true)
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')
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",
docValidation: true,
detectBlur: true,
statusIndicator: true,
torchButton: true,
exitButton: true,
debug_mode: true
});

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
});