Tire & Automotive Scanning Examples

Complete examples for tire, VIN and license plates scanning with the Anyline Web SDK.

Tire Identification Number (TIN/DOT)

Universal TIN Scanning

Scan tire identification numbers with or without DOT prefix (default mode):

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'tin'  // Universal mode: 6-17 characters, A-Z and 0-9
});

anyline.onResult = ({ result }) => {
  const tinResult = result.tinResult;

  console.log('TIN:', tinResult.text);
};

anyline.startScanning();

The Universal TIN mode:

  • Scans TINs with or without DOT prefix

Available preset: tin

TIN/DOT Strict Mode

Scan tire identification numbers with strict DOT validation:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'tin_dot'  // DOT mode: must start with "DOT"
});

anyline.onResult = ({ result }) => {
  const tinResult = result.tinResult;

  console.log('TIN with DOT:', tinResult.text);  // Always starts with "DOT"
};

anyline.startScanning();

The TIN/DOT strict mode:

  • Must start with DOT prefix

Available preset: tin_dot

TIN/DOT with User Feedback

For dynamic UI feedback (lighting and distance guidance) during TIN scanning, see UI Feedback.

Tire Size

Scan tire size information from sidewalls:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'tire_size'
});

anyline.onResult = ({ result }) => {
  const tireSize = result.tireSizeResult;

  // Formatted output
  console.log('Tire Size:', tireSize.prettifiedString.text);  // e.g., "275/35 R22 104W"
};

anyline.startScanning();

Available preset: tire_size

Commercial Tire ID

Scan commercial tire identification numbers:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'tire_id'
});

anyline.onResult = ({ result }) => {
  const tireId = result.commercialTireIdResult;

  console.log('Commercial Tire ID:', tireId.text);
  // Examples: "DKA001958", "A7P367182", "SUT06013R"
};

anyline.startScanning();

Available preset: tire_id

Tire Make

Identify the tire manufacturer using custom configuration (no preset available):

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  config: {
    tireMakeConfig: {},
    cancelOnResult: true
  },
  viewConfig: {
    cutouts: [{
      cutoutConfig: {
        alignment: 'top_half',
        ratioFromSize: {
          width: 720,
          height: 144
        },
        width: 1800,
        maxWidthPercent: '90%'
      }
    }]
  }
});

anyline.onResult = ({ result }) => {
  const brand = result.tireMakeResult;
  console.log('Manufacturer:', brand.text);  // e.g., "Continental"
};

anyline.startScanning();
There is no preset for Tire Make scanning. Use manual configuration with tireMakeConfig as shown above.

Vehicle Identification Number (VIN)

VIN with User Guidance

Scan VINs with dynamic UI feedback (recommended for accuracy).

The vin_with_user_guidance preset with user feedback provides:

  • Dynamic UI feedback: Real-time lighting and distance guidance

  • Static instructions: Custom text above the cutout

  • Enhanced accuracy: Helps users position the camera optimally

Available preset: vin_with_user_guidance (recommended)

Optimized VIN Scanning

Fast VIN scanning without UI guidance:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'vin'  // Faster, Recommended for less performant devices
});

anyline.onResult = ({ result }) => {
  console.log('VIN:', result.vinResult.text);
};

anyline.startScanning();

Available preset: vin

VIN with Check Digit Validation

Enable check digit validation for higher accuracy:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'vin_with_user_guidance',
  config: {
    vinConfig: {
      validateCheckDigit: true,  // Validate ISO 3779 check digit
      charWhitelist: 'ABCDEFGHJKLMNPRSTUVWXYZ0123456789'  // Excludes I, O, Q
    },
    cancelOnResult: true
  }
});

anyline.onResult = ({ result }) => {
  const vinNumber = result.vinResult.text;
  console.log('Validated VIN:', vinNumber);
  // VIN is guaranteed to have correct check digit (position 9)
};

anyline.startScanning();

Web SDK VIN Options:

  • vin_with_user_guidance - Advanced scanning with dynamic UI feedback (recommended for accuracy)

  • vin - Optimized VIN scanning (recommended for speed)

License Plate

The Web SDK supports region- and country-specific scan modes (Europe-wide auto detection, individual EU countries, United States, Canada, Africa, etc.). Pick the scan mode or preset that matches your deployment region for best accuracy.

European License Plates

Scan European license plates with automatic country detection:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'lpt_eu'  // European plates with scanMode: 'auto'
});

anyline.onResult = ({ result }) => {
  const plate = result.licensePlateResult;

  console.log('Plate Number:', plate.plateText);
};

anyline.startScanning();

Supports automatic country detection for European countries when the country identifier is located inside a blue euroband on the license plate.

Available preset: lpt_eu

United States License Plates

Scan US license plates with state detection:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'lpt_us'  // US plates with scanMode: 'unitedstates'
});

anyline.onResult = ({ result }) => {
  const plate = result.licensePlateResult;

  console.log('Plate Number:', plate.plateText);
};

anyline.startScanning();

Supports US states and territories.

Available preset: lpt_us

Canadian License Plates

Scan Canadian license plates with province detection:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  preset: 'lpt_canada'  // Canadian plates with scanMode: 'canada'
});

anyline.onResult = ({ result }) => {
  const plate = result.licensePlateResult;

  console.log('Plate Number:', plate.plateText);
};

anyline.startScanning();

Available preset: lpt_canada

Custom License Plate Configuration

If no preset matches your exact requirements, configure the plugin manually and select the scan mode yourself:

import { init } from '@anyline/anyline-js';

const anyline = init({
  license: 'YOUR_LICENSE_KEY',
  element: document.getElementById('scanner-root'),
  config: {
    licensePlateConfig: {
      scanMode: 'france',         // see schema for full list (auto, germany, unitedstates, canada, africa…)
      minConfidence: 70,
      validationRegex: "'F':^[A-Z0-9\\- ]{4,10}$"
    },
    cancelOnResult: true
  }
});

anyline.onResult = ({ result }) => {
  const plate = result.licensePlateResult;
  if (!plate) return;

  console.log(`[${plate.country}] ${plate.plateText}`);
};

anyline.startScanning();
Use validationRegex to reject unexpected formats and minConfidence to enforce quality thresholds. For European deployments you can also restrict scanMode to a single country (e.g., germany) to improve accuracy over the generic auto mode.

Configuration Reference

For detailed information about all configuration parameters including tinConfig, tireSizeConfig, commercialTireIdConfig, tireMakeConfig, vinConfig, and licensePlateConfig, see the respective technical capabilities pages linked in the See Also section below.

Result Structure

For the complete result structure, see the Plugin Result JSON Schema.

See Also