Plugin Configuration and Presets
The Anyline Web SDK uses two configuration components:
-
PluginConfig (
config): Defines what to scan (e.g., barcode formats, ID types, meter settings) -
ViewConfig (
viewConfig): Defines how scanning appears (e.g., cutout dimensions, visual feedback, UI)
Presets provide pre-configured defaults for common use cases. You can use presets as-is, customize them, or configure entirely from scratch.
Available Presets
| Category | Preset | Description |
|---|---|---|
Barcode |
|
QR code scanning only |
|
All supported 1D and 2D barcode formats |
|
|
PDF417 barcode scanning |
|
|
PDF417 with AAMVA parsing (US driver’s licenses) |
|
ID Scanning |
|
Machine Readable Zone (passports, ID cards) |
|
Austrian and German driving licenses |
|
|
AT/DE driving licenses with strict validation |
|
|
Spanish, Italian, and Portuguese driving licenses |
|
License Plates |
|
General license plate recognition |
|
European license plates |
|
|
United States license plates |
|
|
Canadian license plates |
|
Tire & Automotive |
|
Vehicle Identification Number (fast mode) |
|
VIN with real-time user guidance feedback |
|
|
Tire Identification Number |
|
|
Tire DOT number |
|
|
Tire size information |
|
|
Complete tire identification |
|
Containers |
|
Horizontal shipping container codes |
|
Vertical shipping container codes |
|
Meters |
|
Analog and digital meter reading |
|
Dial meter reading |
|
|
Verbund utility meter |
|
OCR |
|
General optical character recognition |
|
Legacy barcode engine (compatibility mode) |
Customizing Presets
When you provide both a preset and custom config or viewConfig, your values override the preset defaults:
-
The preset’s configuration serves as the base
-
Your custom configuration is merged on top
-
Your values override preset values at any nesting level
const anyline = init({
preset: 'all_barcode_formats',
// Override specific preset values
config: {
barcodeConfig: {
barcodeFormats: ['QR_CODE', 'DATA_MATRIX'],
multiBarcode: true
}
},
// Customize visual appearance
viewConfig: {
cutouts: [{
cutoutConfig: {
strokeColor: '00FF00' // Overrides preset cutout color
}
}]
},
license: 'your-license-key',
element: document.getElementById('root')
});
Configuration Without Presets
You can configure the SDK entirely without presets by providing complete config and viewConfig objects.
const anyline = init({
// No preset specified
config: {
barcodeConfig: {
barcodeFormats: ['QR_CODE'],
multiBarcode: false
},
cancelOnResult: true
},
viewConfig: {
cutouts: [{
cutoutConfig: {
alignment: 'center',
width: 1000,
maxWidthPercent: '80%',
ratioFromSize: {
width: 16,
height: 9
},
strokeColor: 'FFFFFF',
strokeWidth: 3
},
scanFeedback: {
style: 'rect',
strokeColor: '00FF00'
}
}]
},
license: 'your-license-key',
element: document.getElementById('root')
});
|
When configuring manually, provide exactly one plugin-specific section (e.g., |
Configuration Reference
| Configuration | Description | Reference |
|---|---|---|
PluginConfig |
Plugin-specific settings: barcode formats, ID types, meter modes, validation options |
|
ViewConfig |
Visual settings: cutout dimensions, scan feedback, overlay styling |
|
UI Feedback |
Dynamic user guidance: lighting and distance indicators |
|
AnylineJSParams |
All initialization parameters including presets, callbacks, and SDK options |
See Also
-
Getting Started - Quick start guide
-
Examples - Framework integration examples
-
Error Handling - Configuration error handling