Before the STRICH SDK BarcodeReader can be used, a one-time initialization of the SDK must be performed.

Methods

  • Return the current state of the camera permission.

    Uses the Permissions API (https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API) to determine if the user has granted or denied camera permission or if a prompt will occur when the camera is accessed. In all other cases, the value 'unknown' is returned.

    Returns Promise<"denied" | "granted" | "prompt" | "unknown">

    The current state of the camera permission: 'granted' if it is granted, 'denied' if it is denied, 'prompt' if a prompt will occur, and 'unknown' if it could not be determined for any reason.

    Remarks

    The Permissions API is currently not available on Firefox: 'unknown' will be returned.

  • Check if the browser has access to a camera device, which is required for scanning barcodes. This can be used as a check if a BarcodeReader should be presented, or a fallback to a manual input method or error page should be displayed.

    Returns Promise<boolean>

    A Promise that resolves to a boolean value indicating if a camera is available. The Promise will reject if the check fails for any reason (including missing/denied permissions).

  • One-time initialization of the SDK.

    Parameters

    • licenseKey: string

      The license key obtained from the Customer Portal.

    Returns Promise<void>

  • Return true if the SDK was successfully initialized, false otherwise.

    Returns boolean

  • Set custom ID for analytics.

    The custom ID is independent of the device ID, and can be used for custom device identifiers, location identifiers or anonymous user identifiers.

    USING THE CUSTOM ID TO TRANSMIT PERSONALLY IDENTIFYING DATA IS FORBIDDEN AND CONSTITUTES A BREACH OF THE TERMS OF THE LICENSE AGREEMENT.

    Parameters

    • customId: null | string

      The custom ID. Use null to unset the custom ID.

    Returns void

    Default Value

    No custom ID is set by default
    
  • Override the language that was detected from the browser's language (navigator.language)

    Parameters

    • lang: string

      The ISO language code, e.g. 'en'

    Returns void

  • Return the version of the STRICH SDK.

    Returns string

Generated using TypeDoc