Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@scandit/web-barcode-link
Advanced tools
Scandit's Barcode Link SDK allows you to scan barcodes on your mobile device and automatically send them to another device.
$ npm i @scandit/web-barcode-link
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();
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 --");
Specify the scanning mode to enable:
Value | Description |
---|---|
SingleScanning | Send one barcode and close the session |
ContinuousScanning | Send barcodes in realtime and close the session when you want |
SingleListBuilding | Send a list of barcodes and close the session |
ContinuousListBuilding | Send lists of barcodes in realtime and close the session when you want |
import { BarcodeLinkMode } from "@scandit/web-barcode-link";
barcodeLink.setBarcodeLinkMode(BarcodeLinkMode.ContinuousListBuilding);
Specify which symbologies to enable, and optional settings for each symbology:
barcodeLink.setSymbologies({
ean13Upca: { enabled: true },
});
Specify a regex that will be used to ignore barcodes that do not match the regular expression:
barcodeLink.setBarcodeRegexValidation(/\d+/);
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
});
Remove a listener:
barcodeLink.removeListener(listener);
Start the barcode link workflow
Optionally accepts a flow
parameter, that can be used to enable different workflows.
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());
FAQs
The Scandit Web Barcode Link package
We found that @scandit/web-barcode-link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.