Options
All
  • Public
  • Public/Protected
  • All
Menu

Scandit Barcode Scanner SDK for the Web

Index

Functions

configure

  • configure(licenseKey: string, parameters?: ConfigureOptions): Promise<void>
  • Initialize and configure the Scandit Barcode Scanner SDK library. This function must be called (once) before instantiating the main library components (BarcodePicker and Scanner objects) 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. If needed this behaviour can be changed via the preloadEngine and preloadBlurryRecognition options.

    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.

    Camera access requests are done lazily only when needed by a BarcodePicker (or Scanner) object. You can also eagerly ask only for camera access permissions by calling the CameraAccess.getCameras function.

    Ideally, to make the scanning process faster, it is recommended depending on the use case to create in advance a (hidden and paused) BarcodePicker or Scanner object, to later show and unpause it when needed. Depending on the options this can also be used to correctly ask for camera access permissions whenever preferred.

    Parameters

    • licenseKey: string

      The Scandit license key to be used by the library.

    • parameters: ConfigureOptions = {}

    Returns Promise<void>

    A promise resolving when the library has been configured (preloading is done independently asynchronously).

Generated using TypeDoc