Defined under the namespace Scandit.Datacapture.Core

interface ConfigureOptions

Added in version 6.13.0

licenseKey: string

Added in version 6.13.0

The license key.

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 / or another URL location.

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?: Logger.Level

Added in version 6.13.0

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

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: string

Added in version 6.13.0

The name of the module

load(options: ConfigureOptions): Promise<any>

Added in version 6.13.0

An internal function to initialize the module.

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 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.