@scanly/browser
v2.1.0
Published
Browser, Worker, and camera barcode scanning runtime for Scanly SDK
Maintainers
Readme
@scanly/browser
Browser upload, module Worker, camera, ScannerSession, tracking, batch, and default engine composition for Scanly SDK v2.1.0. The optional ZXing-C++ WASM backend is included and loaded lazily.
npm install @scanly/browserimport { BrowserCaptureSession } from "@scanly/browser";
const scanner = new BrowserCaptureSession();
scanner.initialize();
scanner.start();
const outcome = await scanner.scanFile(file);
if (outcome.ok) console.log(outcome.results);
await scanner.dispose();import { BrowserCameraSource } from "@scanly/browser";
const camera = new BrowserCameraSource();
await camera.start(videoElement, {
onResult: console.log,
onError: console.error,
});
camera.stop();
camera.dispose();The Worker is self-hosted through new URL(..., import.meta.url). Deployments must emit the Worker and WASM asset, serve WASM as application/wasm, and permit the Worker URL in CSP worker-src. Camera access requires HTTPS or localhost and user permission. Scanly uses no cloud decoder or telemetry.
This is the standard public Browser package. React users may install @scanly/react, which depends on it.
Version: 2.1.0 · Browser usage and deployment
ScannerSession.stop() remains restartable. ScannerSession.dispose() is terminal: subsequent start(), reset(), and switchSource() calls reject with session_disposed, pending work is drained, and an injected decoder remains caller-owned.
