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

QR code scanning only

all_barcode_formats

All supported 1D and 2D barcode formats

barcode_pdf417

PDF417 barcode scanning

barcode_pdf417_parsed

PDF417 with AAMVA parsing (US driver’s licenses)

ID Scanning

universalid_mrz

Machine Readable Zone (passports, ID cards)

universalid_dl_at_de

Austrian and German driving licenses

universalid_dl_at_de_strict

AT/DE driving licenses with strict validation

universalid_es_it_pt

Spanish, Italian, and Portuguese driving licenses

License Plates

lpt

General license plate recognition

lpt_eu

European license plates

lpt_us

United States license plates

lpt_canada

Canadian license plates

Tire & Automotive

vin

Vehicle Identification Number (fast mode)

vin_with_user_guidance

VIN with real-time user guidance feedback

tin

Tire Identification Number

tin_dot

Tire DOT number

tire_size

Tire size information

tire_id

Complete tire identification

Containers

container

Horizontal shipping container codes

containerVertical

Vertical shipping container codes

Meters

meter

Analog and digital meter reading

dialmeter

Dial meter reading

verbund

Verbund utility meter

OCR

ocr

General optical character recognition

legacy_barcode

Legacy barcode engine (compatibility mode)

Customizing Presets

When you provide both a preset and custom config or viewConfig, your values override the preset defaults:

  1. The preset’s configuration serves as the base

  2. Your custom configuration is merged on top

  3. 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., barcodeConfig or vinConfig). Supplying none or multiple sections causes an initialization error.

Configuration Reference

Configuration Description Reference

PluginConfig

Plugin-specific settings: barcode formats, ID types, meter modes, validation options

Schema Reference

ViewConfig

Visual settings: cutout dimensions, scan feedback, overlay styling

ViewConfig Reference

UI Feedback

Dynamic user guidance: lighting and distance indicators

UI Feedback Guide

AnylineJSParams

All initialization parameters including presets, callbacks, and SDK options

API Reference

See Also