Installing the Web Barcode Scanner SDK
npm
The Scanbot SDK is available as an npm package:
npm install scanbot-web-sdk --save
You can then import the SDK in your JavaScript or Typescript project:
import ScanbotSDK from 'scanbot-web-sdk'
All SDK modules are available under this ScanbotSDK object.
When using the ScanbotSDK object in Typescript projects, most types can be inferred automatically.
However, if necessary, Typescript projects may explicitly include typings by including them from scanbot-web-sdk/@types, e.g.:
import ScanbotSDK from 'scanbot-web-sdk'
import type { IBarcodeScannerHandle } from 'scanbot-web-sdk/@types'
class MyPage {
// We need to explicitly mention the field's type here. We obtain the type via an `import type` statement from `scanbot-web-sdk/@types`.
private barcodeScanner: IBarcodeScannerHandle;
constructor() {
this.barcodeScanner = ScanbotSDK.createBarcodeScanner();
}
}
Manual packing
If you are not using npm in your project, you can still use npm as a one-time command to download the Scanbot Web SDK package:
# Use npm pack to download the SDK package as a tarball
npm pack scanbot-web-sdk
# Extract the tarball
tar -xf scanbot-web-sdk-*.tgz
Now, you can place a <script src="package/bundle/ScanbotSDK.min.js"></script> tag in your index.html. The script puts the SDK entry point into a global variable named ScanbotSDK.
Initializing the SDK
After downloading and importing the SDK, you need to initialize it with your license key.
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
