Options
All
  • Public
  • Public/Protected
  • All
Menu

Scandit Barcode Scanner SDK for the Web

Index

Functions

configure

  • configure(licenseKey: string, __namedParameters?: object): Promise<void>
  • Initialize and configure the Scandit Barcode Scanner SDK library. This function must be called as first thing before using any other function of the library.

    Depending on parameters, device features and user permissions for camera access, any of the following errors could be the rejected result of the returned promise:

    • NoLicenseKeyError
    • UnsupportedBrowserError
    • PermissionDeniedError
    • NotAllowedError
    • NotFoundError
    • AbortError
    • NotReadableError
    • InternalError

    If the external Scandit Engine library is not loaded now, it can later be loaded via loadEngineLibrary, or it will be downloaded and prepared automatically when needed by other objects/functions.

    If the cameras are not accessed now, they can later be loaded via CameraAccess.getCameras, or they will be accessed automatically when needed by other objects/functions.

    Please note that preloading the Scandit Engine library only downloads the library and puts it in a local cache if available (then loads it and verifies the license key). When the library is then required and used by a BarcodePicker instance the external Scandit Engine library needs to be parsed and executed again and thus still requires some time to be ready. To make the process faster it's recommended, if possible, to instead prepare in advance library and cameras via a hidden BarcodePicker instead.

    Parameters

    • licenseKey: string

      The Scandit license key to be used by the library.

    • Default value __namedParameters: object = {}
      • engineLocation: string
        Default = "/"
        The location of the folder containing the external scandit-engine-sdk.min.js and scandit-engine-sdk.wasm files (external Scandit Engine library). By default they are retrieved from the root of the web application. Can be a full URL to folder or an absolute folder path.
      • preloadCameras: boolean
        Default = false
        Whether to eagerly request access (if needed) and access available cameras with this call.
      • preloadEngineLibrary: boolean
        Default = false
        Whether to eagerly download and prepare the external Scandit Engine library with this call (see documentation note).

    Returns Promise<void>

    A promise resolving when the library has loaded and the available cameras are loaded (if selected).

loadEngineLibrary

  • loadEngineLibrary(): Promise<void>
  • Download and prepare in memory the external Scandit Engine library. If this method isn't called manually the library will be automatically loaded the first time it's required by another of this library's components.

    Please note that preloading the Scandit Engine library only downloads the library and puts it in a local cache if available (then loads it and verifies the license key). When the library is then required and used by a BarcodePicker instance the external Scandit Engine library needs to be parsed and executed again and thus still requires some time to be ready. To make the process faster it's recommended, if possible, to instead prepare in advance library and cameras via a hidden BarcodePicker instead.

    Usually this method should not be called and a BarcodePicker object should be created instead.

    Returns Promise<void>

    A promise resolving when the external Scandit Engine library has been loaded and is ready.

Generated using TypeDoc