New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@scandit/web-barcode-link

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scandit/web-barcode-link

The Scandit Web Barcode Link package

0.3.0
latest
npm
Version published
Weekly downloads
81
8000%
Maintainers
0
Weekly downloads
 
Created
Source

Scandit's Barcode Link SDK enables seamless barcode scanning between a desktop and a mobile device.

Installation

npm install @scandit/web-barcode-link

Quick Start

import { BarcodeLink, BarcodeLinkMode } from "@scandit/web-barcode-link";

const barcodeLink = BarcodeLink.forLicenseKey("YOUR_LICENSE_KEY")
	.setBarcodeLinkMode(BarcodeLinkMode.SingleScanning)
	.addListener({
		onCapture(barcodes, finished) {
			console.log("Scanned:", barcodes);
		},
	});

await barcodeLink.initialize();

API

Main class for barcode scanning functionality.

import { BarcodeLink } from "@scandit/web-barcode-link";

const barcodeLink = BarcodeLink.forLicenseKey("YOUR_LICENSE_KEY")
	.setSymbologies({
		/* symbology settings */
	})
	.setBarcodeRegexValidation(/pattern/)
	.setPlatform(BarcodeLinkPlatform.Web)
	.setListBehavior(BarcodeLinkListBehavior.Unique)
	.addListener({
		onCapture(barcodes, finished) {
			/* ... */
		},
		onCancel() {
			/* ... */
		}, // Only available in the ui flow
		onDeviceConnected() {
			/* ... */
		}, // Only available in the uiless flow
		onDeviceDisconnected() {
			/* ... */
		}, // Only available in the uiless flow
	});

BarcodeLinkMode

Controls how scanning behaves.

import { BarcodeLinkMode } from "@scandit/web-barcode-link";

barcodeLink.setBarcodeLinkMode(BarcodeLinkMode.SingleScanning);

// Available modes:
BarcodeLinkMode.SingleScanning; // Scan a single barcode and finish
BarcodeLinkMode.ContinuousScanning; // Continuously scan barcodes
BarcodeLinkMode.SingleListBuilding; // Build a list of barcodes and finish
BarcodeLinkMode.ContinuousListBuilding; // Continuously build lists of barcodes

BarcodeLinkListBehavior

Controls how barcodes are collected when using list building modes.

import { BarcodeLinkListBehavior } from "@scandit/web-barcode-link";

barcodeLink.setListBehavior(BarcodeLinkListBehavior.Unique);

// Available behaviors:
BarcodeLinkListBehavior.Unique; // Each barcode can only appear once in the list
BarcodeLinkListBehavior.Count; // Keep track of how many times each barcode is scanned

BarcodeLinkPlatform

Specifies the platform type for the scanning device.

import { BarcodeLinkPlatform } from "@scandit/web-barcode-link";

barcodeLink.setPlatform(BarcodeLinkPlatform.Web);

// Available platforms:
BarcodeLinkPlatform.Express; // Launch the Scandit Express app when scanning the QR code
BarcodeLinkPlatform.Web; // Launch a new browser tab with the Scandit Web SDK when scanning the QR code

BarcodeLinkSymbology

Imported from @scandit/web-datacapture-barcode, defines supported barcode types.

import { BarcodeLinkSymbology } from "@scandit/web-barcode-link";

barcodeLink.setSymbologies({
	[BarcodeLinkSymbology.Ean13Upca]: { enabled: true },
});

BarcodeLinkUiFlow

Default flow implementation with built-in UI.

import { BarcodeLinkUiFlow } from "@scandit/web-barcode-link";

await barcodeLink.initialize(new BarcodeLinkUiFlow());

BarcodeLinkUilessFlow

Headless flow implementation that returns QR code data.

import { BarcodeLinkUilessFlow } from "@scandit/web-barcode-link";

const qrCode = await barcodeLink.initialize(new BarcodeLinkUilessFlow());
// qrCode: { href: string, src: string }

License

Requires a valid Scandit license key.

Keywords

scandit

FAQs

Package last updated on 05 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts