Configuration Options
The SDK accepts a configuration object during initialization with the following options:
Core Settings
Option | Type | Default | Description |
---|---|---|---|
lensFlavor | string | Required | Determines 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 |
container | string | undefined | HTML element ID where lens will mount. Creates full-screen overlay if not specified |
debug_mode | boolean | false | Enables debug logging to console |
Document Processing
Option | Type | Default | Description |
---|---|---|---|
docValidation | boolean | false | Enables document detection validation |
detectBlur | boolean | false | Enables blur detection during capture |
detectScreenCapture | boolean | false | Enables detection of screen capture attempts |
UI Elements
Option | Type | Default | Description |
---|---|---|---|
torchButton | boolean | false | Adds flashlight toggle button (requires device support) |
exitButton | boolean | false | Adds button to close camera view |
blurModal | boolean | false | Shows warning when blur detected (requires detectBlur: true ) |
isDocumentModal | boolean | false | Shows warning when no document detected (requires docValidation: true ) |
enableSubmit | boolean | true | Shows submit button after successful capture |
Special Features
Option | Type | Default | Description |
---|---|---|---|
captureBackOfCheck | boolean | false | Enables back side capture for checks (requires lensFlavor: 'checks' ) |
enableLongReceiptPreview | boolean | false | Shows preview during receipt stitching (requires lensFlavor: 'long_document' ) |
Navigation & Callbacks
Option | Type | Default | Description |
---|---|---|---|
onCloseRedirectUrl | string | undefined | URL to redirect to when exit pressed |
onClose | function | undefined | Callback 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
});