Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scandit/web-barcode-link

Package Overview
Dependencies
Maintainers
4
Versions
4
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.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Scandit's Barcode Link SDK allows you to scan barcodes on your mobile device and automatically send them to another device.

Installation

$ npm i @scandit/web-barcode-link

Getting started

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

const barcodeLink = BarcodeLink.forLicenseKey("-- ENTER YOUR SCANDIT LICENSE KEY HERE --")
	.setBarcodeLinkMode(BarcodeLinkMode.ContinuousListBuilding)
	.setSymbologies({ ean13Upca: { enabled: true } })
	.addListener({
		onCapture: (barcodes) => console.log("Captured:", barcodes}),
	});

await barcodeLink.initialize();

API

forLicenseKey

Static method for creating a new BarcodeLink instance with your license key. This is the only way to construct a new BarcodeLink instance.

const barcodeLink = BarcodeLink.forLicenseKey("-- ENTER YOUR SCANDIT LICENSE KEY HERE --");
setBarcodeLinkMode

Specify the scanning mode to enable:

ValueDescription
SingleScanningSend one barcode and close the session
ContinuousScanningSend barcodes in realtime and close the session when you want
SingleListBuildingSend a list of barcodes and close the session
ContinuousListBuildingSend lists of barcodes in realtime and close the session when you want
import { BarcodeLinkMode } from "@scandit/web-barcode-link";

barcodeLink.setBarcodeLinkMode(BarcodeLinkMode.ContinuousListBuilding);
setSymbologies

Specify which symbologies to enable, and optional settings for each symbology:

barcodeLink.setSymbologies({
	ean13Upca: { enabled: true },
});
setBarcodeRegexValidation (optional)

Specify a regex that will be used to ignore barcodes that do not match the regular expression:

barcodeLink.setBarcodeRegexValidation(/\d+/);
addListener

Add a listener to listen to specific events:

barcodeLink.addListener({
	onCancel?() {}
	onCapture?(barcodes) {}
	onDeviceConnected?() {} // Only triggered in a uiless flow
	onDeviceDisconnected?() {} // Only triggered in a uiless flow
});
removeListener

Remove a listener:

barcodeLink.removeListener(listener);
initialize

Start the barcode link workflow Optionally accepts a flow parameter, that can be used to enable different workflows.

BarcodeLinkUiFlow

Opens a popup that will guide you through the scanning process. This is the default flow.

await barcodeLink.initialize();

// Equivalent
await barcodeLink.initialize(new BarcodeLinkUiFlow());

Keywords

FAQs

Package last updated on 08 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc