Configuration

Defined under the namespace Scandit.Datacapture.Core

ConfigureOptions
interface ConfigureOptions

Added in version 6.13.0

licenseKey
licenseKey: string

Added in version 6.13.0

The license key.

licenseDataPath
licenseDataPath?: string

Added in version 6.23.0

In Electron context the path where the encrypted license key is placed inside the app starting from app.getAppPath(). For example ./out/renderer/sdc-license.data will be resolved internally like path.join(electronApp.getAppPath(), ‘./out/renderer/sdc-license.data’).

libraryLocation
libraryLocation: string

Added in version 6.13.0

The location of the folder containing the external scandit-datacapture-sdk-*.js and scandit-datacapture-sdk-*.wasm files (external Scandit Data Capture library). By default they are retrieved from the root of the web application. Can be a relative URL or an absolute one, pointing to a CDN for example https://cdn.jsdelivr.net/npm/@scandit/web-datacapture-barcode@7.0/sdc-lib / https://unpkg.com/@scandit/web-datacapture-barcode@7.0/sdc-lib or another URL location.

moduleLoaders
moduleLoaders: ModuleLoader[]

Added in version 6.13.0

An array of modules that will be loaded. Currently only an array containing one single value must be passed, an empty array will trigger a DataCaptureError. Each data capture module provides a function to load itself, like the Barcode.barcodeCaptureLoader() for example.

logLevel
logLevel?: Logger.Level

Added in version 6.13.0

The console log level to be used by the library. Level.Debug by default.

ModuleLoader
interface ModuleLoader

Added in version 6.13.0

Internal interface to load a data capture module. Every module provides a function which returns a ModuleLoader when called. ModuleLoaders are passed to the configure() options.

moduleName
moduleName: string

Added in version 6.13.0

The name of the module

load(options)
load(options: ConfigureOptions): Promise<any>

Added in version 6.13.0

An internal function to initialize the module.

configure(options)
function configure(options: ConfigureOptions): Promise<void>

Added in version 6.13.0

Configure and initialize the Scandit Barcode Scanner SDK library. This function must be called (once) before instantiating the main library components and returns a promise. In case this is called again after a successful call, parameters from subsequent calls are ignored and the same promise returned from the successful call will be returned.

Depending on parameters and browser features, any of the following errors could be the rejected result of the returned promise:

  • NoLicenseKeyError

  • UnsupportedBrowserError

The external Scandit Data Capture library and data needed for barcode blurry recognition are preloaded asynchronously eagerly by default after library configuration to ensure the best performance.

For optimal performance, it is recommended to call this function as soon as possible to ensure needed components are preloaded and initialized ahead of time.

Ideally, to make the scanning process faster, it is recommended depending on the use case to create in advance the required objects (e.g. DataCaptureContext, …) which compose your scanner to later show and unpause it when needed.