On this page

Stuck? Open a support ticket and the barKoder team will help. Open a ticket

API reference

Every method, setting, enum and result of the barKoder Cordova SDK, grouped by what you do with it.

Scanning & session #

initialize #

TypeScript
initialize(width: number, height: number, x: number, y: number)

Initializes the Barkoder scanner with the specified dimensions and position.

Parameters:

ParameterTypeDescription
widthnumberThe width of the scanner view
heightnumberThe height of the scanner view
xnumberThe X position of the scanner view
ynumberThe Y position of the scanner view

registerWithLicenseKey #

TypeScript
registerWithLicenseKey(licenseKey: string)

Registers the Barkoder scanner with the specified license key.

Parameters:

ParameterTypeDescription
licenseKeystringThe license key to register the Barkoder scanner

startScanning #

TypeScript
startScanning(success: (data: any) => void, error: (err: any) => void)

Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed.

Parameters:

ParameterTypeDescription
success(data: any) => voidReceives a raw scan result. See Scan Callbacks for conversion to BarkoderResult.
error(err: any) => voidHandles scanning errors reported by the plugin.

stopScanning #

TypeScript
stopScanning()

Halts the barcode scanning process, stopping the camera from capturing and processing barcode information.

pauseScanning #

TypeScript
pauseScanning()

Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session.

freezeScanning #

TypeScript
freezeScanning()

Freezes the current AR scanning session by capturing a still image from the camera feed. Use only when AR mode is enabled to temporarily freeze the view while keeping overlays visible.

unfreezeScanning #

TypeScript
unfreezeScanning()

Unfreezes the AR scanning session by removing the still image and reactivating the camera and overlays. Use only when AR mode is enabled to restore the live AR view and continue scanning.

setThreadsLimit #

TypeScript
setThreadsLimit(threadsLimit: number)

Sets the threads limit for decoding operations.

Parameters:

ParameterTypeDescription
threadsLimitnumberThe maximum number of threads to use for decoding

getThreadsLimit #

TypeScript
getThreadsLimit()

Retrieves the threads limit.

setDecodingSpeed #

TypeScript
setDecodingSpeed(decodingSpeed: number)

Sets the decoding speed for barcode scanning.

Parameters:

ParameterTypeDescription
decodingSpeednumberThe decoding speed to set for the barcode scanner

getDecodingSpeed #

TypeScript
getDecodingSpeed()

Retrieves the current decoding speed setting for barcode scanning.

setMatchFilter #

TypeScript
setMatchFilter(value: string)

Sets a string or regular expression used to match decoded barcode data.

Parameters:

ParameterTypeDescription
valuestringThe string or regular expression used to match decoded barcode data

getMatchFilter #

TypeScript
getMatchFilter()

Retrieves the string or regular expression used to match decoded barcode data.

setUPCEexpandToUPCA #

TypeScript
setUPCEexpandToUPCA(enabled: boolean)

Sets whether the UPC-E barcodes should be expanded to UPC-A format.

Parameters:

ParameterTypeDescription
enabledbooleanA boolean indicating whether to enable the expansion for UPC-E barcodes

setUPCE1expandToUPCA #

TypeScript
setUPCE1expandToUPCA(enabled: boolean)

Sets whether the UPC-E1 barcodes should be expanded to UPC-A format.

Parameters:

ParameterTypeDescription
enabledbooleanA boolean indicating whether to enable the expansion for UPC-E1 barcodes

setDynamicExposure #

TypeScript
setDynamicExposure(intensity: number)

Sets the camera's exposure dynamically based on the provided intensity, cycling through predefined compensation values.

Parameters:

ParameterTypeDescription
intensitynumberThe integer value for the exposure intensity

setVideoStabilization #

TypeScript
setVideoStabilization(value: boolean)

Enables or disables video stabilization for smoother video capture.

Parameters:

ParameterTypeDescription
valuebooleanA boolean indicating whether video stabilization should be enabled/disabled

configureBarkoder #

TypeScript
configureBarkoder(barkoderConfig: object)

Configures the Barkoder functionality based on the provided configuration.

Parameters:

ParameterTypeDescription
barkoderConfigobjectThe configuration object for Barkoder scanner

setPowerSavingMode #

TypeScript
setPowerSavingMode(powerSavingMode: number)

Power saving mode level. Higher values reduce CPU/battery usage by limiting frame processing.

Default value is 0. 0 - Disabled (full performance) 1 - Light saving 2 - Medium saving 3 - High saving 4 - Maximum saving

Parameters:

ParameterTypeDescription
powerSavingModenumberThe power saving mode level to set.

getPowerSavingMode #

TypeScript
getPowerSavingMode()

Retrieves the power saving mode level.

selectVisibleBarcodes #

TypeScript
selectVisibleBarcodes()

Selects all barcodes that are currently visible in AR mode.

getVersion #

TypeScript
getVersion()

Retrieves the version of the Barkoder SDK.

getLibVersion #

TypeScript
getLibVersion()

Retrieves the version of the Barkoder library.

getDeviceId #

TypeScript
getDeviceId()

Retrieves the Device ID.

Camera #

startCamera #

TypeScript
startCamera()

Starts the camera for barcode scanning preparation.

setZoomFactor #

TypeScript
setZoomFactor(zoomFactor: number)

Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning.

Parameters:

ParameterTypeDescription
zoomFactornumberThe zoom factor to set. This should be a positive number

getCurrentZoomFactor #

TypeScript
getCurrentZoomFactor()

Retrieves the current zoom factor for the device's camera.

getMaxZoomFactor #

TypeScript
getMaxZoomFactor()

Retrieves the maximum available zoom factor for the device's camera.

setFlashEnabled #

TypeScript
setFlashEnabled(enabled: boolean)

Enables or disables the device's flash (torch) for illumination during barcode scanning.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable the flash, false to disable it

isFlashAvailable #

TypeScript
isFlashAvailable()

Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning.

setLocationInPreviewEnabled #

TypeScript
setLocationInPreviewEnabled(enabled: boolean)

Enables or disables the display of barcode location information on the camera preview.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to display location information in the scanning preview, false to hide it

isLocationInPreviewEnabled #

TypeScript
isLocationInPreviewEnabled()

Checks if location in preview is enabled.

setPinchToZoomEnabled #

TypeScript
setPinchToZoomEnabled(enabled: boolean)

Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable pinch-to-zoom gesture, false to disable it

isPinchToZoomEnabled #

TypeScript
isPinchToZoomEnabled()

Checks if pinch to zoom is enabled.

setBarkoderResolution #

TypeScript
setBarkoderResolution(resolution: number)

Sets the resolution for barcode scanning.

Parameters:

ParameterTypeDescription
resolutionnumberThe resolution to set for the barcode scanner

getBarkoderResolution #

TypeScript
getBarkoderResolution()

Retrieves the resolution for barcode scanning.

setCentricFocusAndExposure #

TypeScript
setCentricFocusAndExposure(value: boolean)

Sets the camera to use the center of the viewfinder for focus and exposure.

Parameters:

ParameterTypeDescription
valuebooleanA boolean indicating whether the center of the viewfinder should be used

setCamera #

TypeScript
setCamera(value: number)

Sets the camera to be used for scanning (back/front).

Parameters:

ParameterTypeDescription
valuenumberThe value which camera should be used

setPreviewMirrored #

TypeScript
setPreviewMirrored(value: boolean)

Controls whether the front camera preview is horizontally mirrored.

Parameters:

ParameterTypeDescription
valuebooleanSet to true to mirror the preview, false to disable mirroring

isPreviewMirrored #

TypeScript
isPreviewMirrored()

Retrieves whether the front camera preview is horizontally mirrored.

Barcode types #

setBarcodeTypeEnabled #

TypeScript
setBarcodeTypeEnabled(type: number, enabled: boolean)

Sets whether a specific barcode type is enabled.

Parameters:

ParameterTypeDescription
typenumberThe barcode type to enable or disable
enabledbooleanSet to true to enable the barcode type, false to disable it

isBarcodeTypeEnabled #

TypeScript
isBarcodeTypeEnabled(type: number)

Checks if a specific barcode type is enabled.

Parameters:

ParameterTypeDescription
typenumberThe barcode type to check

setBarcodeTypeLengthRange #

TypeScript
setBarcodeTypeLengthRange(type: number, min: number, max: number)

Sets the length range for the specified barcode type.

Parameters:

ParameterTypeDescription
typenumberThe barcode type to configure
minnumberThe minimum length
maxnumberThe maximum length

getBarcodeTypeLengthRange #

TypeScript
getBarcodeTypeLengthRange(type: number)

Retrieves the length range of a specific barcode type.

Parameters:

ParameterTypeDescription
typenumberThe barcode type to check

setEncodingCharacterSet #

TypeScript
setEncodingCharacterSet(characterSet: string)

Sets the encoding character set for barcode scanning.

Parameters:

ParameterTypeDescription
characterSetstringThe character set to use for encoding data

getEncodingCharacterSet #

TypeScript
getEncodingCharacterSet()

Retrieves the character set used for encoding barcode data.

setFormattingType #

TypeScript
setFormattingType(formattingType: number)

Sets the formatting type for barcode scanning.

Parameters:

ParameterTypeDescription
formattingTypenumberThe formatting type to set for the barcode scanner

getFormattingType #

TypeScript
getFormattingType()

Retrieves the formatting type used for presenting decoded barcode data.

setCode11ChecksumType #

TypeScript
setCode11ChecksumType(checksumType: number)

Sets the Code11 checksum type.

Parameters:

ParameterTypeDescription
checksumTypenumberThe checksum type to set for Code 11 barcodes

getCode11ChecksumType #

TypeScript
getCode11ChecksumType()

Retrieves the Code11 checksum type.

setMsiChecksumType #

TypeScript
setMsiChecksumType(checksumType: number)

Sets the MSI checksum type.

Parameters:

ParameterTypeDescription
checksumTypenumberThe checksum type to set for the MSI barcode scanner

getMsiChecksumType #

TypeScript
getMsiChecksumType()

Retrieves the MSI checksum type.

setCode39ChecksumType #

TypeScript
setCode39ChecksumType(checksumType: number)

Sets the Code39 checksum type.

Parameters:

ParameterTypeDescription
checksumTypenumberThe checksum type to set for Code 39 barcodes

getCode39ChecksumType #

TypeScript
getCode39ChecksumType()

Retrieves the checksum type for Code 39 barcodes.

setUpcEanDeblurEnabled #

TypeScript
setUpcEanDeblurEnabled(enabled: boolean)

Sets whether the deblurring feature for UPC/EAN barcodes is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable UPC/EAN deblur, false to disable it

isUpcEanDeblurEnabled #

TypeScript
isUpcEanDeblurEnabled()

Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes.

setMisshaped1DEnabled #

TypeScript
setMisshaped1DEnabled(enabled: boolean)

Sets whether the detection of misshaped 1D barcodes is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable detection of misshaped 1D barcodes, false to disable it

isMisshaped1DEnabled #

TypeScript
isMisshaped1DEnabled()

Checks if the detection of misshaped 1D barcodes is enabled.

setEnableVINRestrictions #

TypeScript
setEnableVINRestrictions(enableVINRestrictions: boolean)

Sets whether Vehicle Identification Number (VIN) restrictions are enabled.

Parameters:

ParameterTypeDescription
enableVINRestrictionsbooleanSet to true to enable VIN restrictions, false to disable them

isVINRestrictionsEnabled #

TypeScript
isVINRestrictionsEnabled()

Checks if VIN restrictions are enabled.

setDatamatrixDpmModeEnabled #

TypeScript
setDatamatrixDpmModeEnabled(enabled: boolean)

Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable Data Matrix DPM mode, false to disable it

isDatamatrixDpmModeEnabled #

TypeScript
isDatamatrixDpmModeEnabled()

Retrieves whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

setQrDpmModeEnabled #

TypeScript
setQrDpmModeEnabled(enabled: boolean)

Sets whether the Direct Part Marking (DPM) mode for QR barcodes is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable QR DPM mode, false to disable it

isQrDpmModeEnabled #

TypeScript
isQrDpmModeEnabled()

Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.

setQrMicroDpmModeEnabled #

TypeScript
setQrMicroDpmModeEnabled(enabled: boolean)

Sets whether the Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable QR Micro DPM mode, false to disable it

isQrMicroDpmModeEnabled #

TypeScript
isQrMicroDpmModeEnabled()

Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

setQrMultiPartMergeEnabled #

TypeScript
setQrMultiPartMergeEnabled(enabled: boolean)

Sets whether the QR multi-part merge is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable QR multi-part merge, false to disable it

isQrMultiPartMergeEnabled #

TypeScript
isQrMultiPartMergeEnabled()

Retrieves whether QR multi-part merge is enabled.

setIdDocumentMasterChecksumEnabled #

TypeScript
setIdDocumentMasterChecksumEnabled(enabled: boolean)

Sets whether Master checksum should be required when scanning ID Documents.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable Master checksum, false to disable it

isIdDocumentMasterChecksumEnabled #

TypeScript
isIdDocumentMasterChecksumEnabled()

Retrieves whether Master checksum is enabled when scanning ID Documents.

setCustomOption #

TypeScript
setCustomOption(option: string, value: number)

Sets a custom option.

See more details about available options and their values.

Parameters:

ParameterTypeDescription
optionstringThe string value for the custom option
valuenumberThe integer value for the custom option

setCustomOptionGlobal #

TypeScript
setCustomOptionGlobal(option: string, value: number)

Sets a custom option globally (must be called before initialize(), which creates the native configuration).

Parameters:

ParameterTypeDescription
optionstringThe string key for the custom option
valuenumberThe integer value for the custom option

setEnableComposite #

TypeScript
setEnableComposite(value: number)

Sets whether Composite Mode should be enabled when scanning.

Parameters:

ParameterTypeDescription
valuenumberThe integer value if composite mode should be enabled

Results #

captureImage #

TypeScript
captureImage()

Captures the latest camera frame.

scanImage #

TypeScript
scanImage(base64: string, success: (data: any) => void, error: (err: any) => void)

Scan barcodes from a base64 string image.

Parameters:

ParameterTypeDescription
base64stringBase64 encoded image string without a data URL prefix.
success(data: any) => voidReceives a raw scan result. See Scan Callbacks for conversion to BarkoderResult.
error(err: any) => voidHandles errors reported by the plugin; invalid image input may not invoke this callback.

setCloseSessionOnResultEnabled #

TypeScript
setCloseSessionOnResultEnabled(enabled: boolean)

Enables or disables the automatic closing of the scanning session upon detecting a barcode result.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable automatic session closure, false to disable it

isCloseSessionOnResultEnabled #

TypeScript
isCloseSessionOnResultEnabled()

Checks if the automatic closing of the scanning session upon detection is enabled.

setImageResultEnabled #

TypeScript
setImageResultEnabled(enabled: boolean)

Enables or disables the capturing and processing of image data when a barcode is successfully detected.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to include an image in the result, false to exclude it

isImageResultEnabled #

TypeScript
isImageResultEnabled()

Checks if the capturing and processing of image data when a barcode is successfully detected is enabled.

setBeepOnSuccessEnabled #

TypeScript
setBeepOnSuccessEnabled(enabled: boolean)

Enables or disables the audible beep sound upon successfully decoding a barcode.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable the beep sound, false to disable it

isBeepOnSuccessEnabled #

TypeScript
isBeepOnSuccessEnabled()

Retrieves the value indicating whether a beep sound is played on successful barcode scanning.

setVibrateOnSuccessEnabled #

TypeScript
setVibrateOnSuccessEnabled(enabled: boolean)

Enables or disables the device vibration upon successfully decoding a barcode.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable vibration, false to disable it

isVibrateOnSuccessEnabled #

TypeScript
isVibrateOnSuccessEnabled()

Retrieves the value indicating whether vibration is enabled on successful barcode scanning.

setReturnOnlyMatchedResults #

TypeScript
setReturnOnlyMatchedResults(value: boolean)

Controls whether only results matching the configured match filter are returned.

If false, all decoded results are returned, including unmatched results.

This option only applies when a match filter is active.

Parameters:

ParameterTypeDescription
valuebooleanSet to true to return only matched results, false to return all decoded results

getReturnOnlyMatchedResults #

TypeScript
getReturnOnlyMatchedResults()

Retrieves whether only results matching the configured match filter are returned.

setMulticodeCachingEnabled #

TypeScript
setMulticodeCachingEnabled(enabled: boolean)

Sets whether multi-code caching is enabled.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to enable multi-code caching, false to disable it

getMulticodeCachingEnabled #

TypeScript
getMulticodeCachingEnabled()

Retrieves whether multi-code caching is enabled.

setMulticodeCachingDuration #

TypeScript
setMulticodeCachingDuration(duration: number)

Sets the caching duration (in milliseconds) for multi-code results.

Parameters:

ParameterTypeDescription
durationnumberThe caching duration in milliseconds for multi-code barcode scanning

getMulticodeCachingDuration #

TypeScript
getMulticodeCachingDuration()

Retrieves the caching duration (in milliseconds) for multi-code results.

setMaximumResultsCount #

TypeScript
setMaximumResultsCount(resultsCount: number)

Sets the maximum number of results to be returned from barcode scanning.

Parameters:

ParameterTypeDescription
resultsCountnumberThe maximum number of results to return

getMaximumResultsCount #

TypeScript
getMaximumResultsCount()

Retrieves the maximum number of results to be returned from barcode scanning at once.

setThresholdBetweenDuplicatesScans #

TypeScript
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans: number)

Sets the threshold between duplicate scans.

Parameters:

ParameterTypeDescription
thresholdBetweenDuplicatesScansnumberThe threshold between duplicate scans

getThresholdBetweenDuplicatesScans #

TypeScript
getThresholdBetweenDuplicatesScans()

Retrieves the threshold between duplicate scans.

setBarcodeThumbnailOnResultEnabled #

TypeScript
setBarcodeThumbnailOnResultEnabled(enabled: boolean)

Enables or disables the barcode thumbnail on result.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to include the barcode thumbnail in the result, false to exclude it

isBarcodeThumbnailOnResultEnabled #

TypeScript
isBarcodeThumbnailOnResultEnabled()

Checks if the barcode thumbnail on result is enabled.

setShowDuplicatesLocations #

TypeScript
setShowDuplicatesLocations(value: boolean)

Enables or disables showing duplicate barcode locations on the preview overlay.

Parameters:

ParameterTypeDescription
valuebooleanA boolean indicating whether to show duplicate locations

getShowDuplicatesLocations #

TypeScript
getShowDuplicatesLocations()

Retrieves whether showing duplicate barcode locations in the AR view is enabled.

Region & overlay #

setLocationLineColor #

TypeScript
setLocationLineColor(hexColor: string)

Sets the color of the lines used to indicate the location of detected barcodes on the camera feed.

Parameters:

ParameterTypeDescription
hexColorstringThe color to set for the location lines, specified in hexadecimal format (e.g., '#FF0000' for red)

getLocationLineColorHex #

TypeScript
getLocationLineColorHex()

Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes.

setLocationLineWidth #

TypeScript
setLocationLineWidth(lineWidth: number)

Sets the width of the lines indicating the location of detected barcodes on the camera feed.

Parameters:

ParameterTypeDescription
lineWidthnumberThe width of the location lines, in pixels. Must be a positive number

getLocationLineWidth #

TypeScript
getLocationLineWidth()

Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed.

setRoiLineColor #

TypeScript
setRoiLineColor(hexColor: string)

Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
hexColorstringThe color to set for the ROI lines, in hexadecimal format (e.g., '#FF0000' for red)

getRoiLineColorHex #

TypeScript
getRoiLineColorHex()

Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview.

setRoiLineWidth #

TypeScript
setRoiLineWidth(lineWidth: number)

Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
lineWidthnumberThe width of the ROI lines, in pixels. This should be a positive number

getRoiLineWidth #

TypeScript
getRoiLineWidth()

Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview.

setRoiOverlayBackgroundColor #

TypeScript
setRoiOverlayBackgroundColor(hexColor: string)

Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
hexColorstringThe background color to set for the ROI overlay, in hexadecimal format (e.g., '#FF0000' for red)

getRoiOverlayBackgroundColorHex #

TypeScript
getRoiOverlayBackgroundColorHex()

Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview.

setRegionOfInterest #

TypeScript
setRegionOfInterest(left: number, top: number, width: number, height: number)

Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes.

Parameters:

ParameterTypeDescription
leftnumberThe left position of the ROI
topnumberThe top position of the ROI
widthnumberThe width of the ROI
heightnumberThe height of the ROI

getRegionOfInterest #

TypeScript
getRegionOfInterest()

Retrieves the region of interest (ROI) configuration.

setRegionOfInterestVisible #

TypeScript
setRegionOfInterestVisible(regionOfInterestVisible: boolean)

Sets the visibility of the Region of Interest (ROI) on the camera preview.

Parameters:

ParameterTypeDescription
regionOfInterestVisiblebooleanSet to true to make the region of interest visible, false to hide it

isRegionOfInterestVisible #

TypeScript
isRegionOfInterestVisible()

Checks if the region of interest (ROI) is visible.

setRoiCenterMark #

TypeScript
setRoiCenterMark(value: number)

Sets the visual marker displayed at the center of the Region of Interest (ROI).

Parameters:

ParameterTypeDescription
valuenumberThe ROI center mark style to set

getRoiCenterMark #

TypeScript
getRoiCenterMark()

Retrieves the visual marker displayed at the center of the Region of Interest (ROI).

setScanningIndicatorColor #

TypeScript
setScanningIndicatorColor(hexColor: string)

Sets the color of the lines outlining the scanning indicator for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
hexColorstringThe hexadecimal representation of the color

getScanningIndicatorColorHex #

TypeScript
getScanningIndicatorColorHex()

Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.

setScanningIndicatorWidth #

TypeScript
setScanningIndicatorWidth(lineWidth: number)

Sets the width of the scanning indicator for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
lineWidthnumberThe width of the scanning indicator to set

getScanningIndicatorWidth #

TypeScript
getScanningIndicatorWidth()

Retrieves the current width setting for the scanning indicator on the camera preview.

setScanningIndicatorAnimation #

TypeScript
setScanningIndicatorAnimation(animation: number)

Sets the animation of the scanning indicator for barcode scanning on the camera feed.

Parameters:

ParameterTypeDescription
animationnumberThe animation of the scanning indicator to set

getScanningIndicatorAnimation #

TypeScript
getScanningIndicatorAnimation()

Retrieves the current animation setting for the scanning indicator on the camera preview.

setScanningIndicatorAlwaysVisible #

TypeScript
setScanningIndicatorAlwaysVisible(value: boolean)

Sets the scanning indicator to be always shown on the camera feed.

Parameters:

ParameterTypeDescription
valuebooleanA boolean indicating whether the scanning indicator should always remain visible

isScanningIndicatorAlwaysVisible #

TypeScript
isScanningIndicatorAlwaysVisible()

Retrieves whether the scanning indicator is always visible on the camera preview.

setLocationInImageResultEnabled #

TypeScript
setLocationInImageResultEnabled(enabled: boolean)

Enables or disables the inclusion of barcode location information within the image data result.

Parameters:

ParameterTypeDescription
enabledbooleanSet to true to include location information in the image result, false to exclude it

isLocationInImageResultEnabled #

TypeScript
isLocationInImageResultEnabled()

Checks if the inclusion of barcode location information within the image data result is enabled.

AR mode #

setARMode #

TypeScript
setARMode(value: number)

Sets the AR mode used for barcode scanning visualization.

Parameters:

ParameterTypeDescription
valuenumberThe AR mode (e.g., interactive, non-interactive, match filter or off)

getARMode #

TypeScript
getARMode()

Retrieves the current AR mode used for barcode scanning.

setARReturnOnlyMatchedResults #

TypeScript
setARReturnOnlyMatchedResults(value: boolean)

Controls whether only matched results are returned in AR match filter mode.

If false, all detected results are returned, while unmatched results have isMatched set to false.

This option only applies when AR mode is matchFilter and a match filter is active.

Parameters:

ParameterTypeDescription
valuebooleanSet to true to return only matched results, false to return all detected results

getARReturnOnlyMatchedResults #

TypeScript
getARReturnOnlyMatchedResults()

Retrieves whether only matched results are returned in AR match filter mode.

setARDisplayOnlyMatchedResults #

TypeScript
setARDisplayOnlyMatchedResults(value: boolean)

Controls whether only matched results are displayed in AR match filter mode.

If false, all decoded results are displayed, including unmatched results.

This option only applies when AR mode is matchFilter and a match filter is active.

Parameters:

ParameterTypeDescription
valuebooleanSet to true to display only matched results, false to display all decoded results

getARDisplayOnlyMatchedResults #

TypeScript
getARDisplayOnlyMatchedResults()

Retrieves whether only matched results are displayed in AR match filter mode.

setARResultDisappearanceDelayMs #

TypeScript
setARResultDisappearanceDelayMs(value: number)

Sets the delay after which a detected AR result is considered expired.

Parameters:

ParameterTypeDescription
valuenumberDelay in milliseconds

getARResultDisappearanceDelayMs #

TypeScript
getARResultDisappearanceDelayMs()

Retrieves the delay after which AR results disappear once detected.

setARLocationTransitionSpeed #

TypeScript
setARLocationTransitionSpeed(value: number)

Sets the speed of overlay transition for AR barcode locations.

Parameters:

ParameterTypeDescription
valuenumberTransition speed value

getARLocationTransitionSpeed #

TypeScript
getARLocationTransitionSpeed()

Retrieves the transition speed for AR barcode location overlays.

setAROverlayRefresh #

TypeScript
setAROverlayRefresh(value: number)

Sets the refresh mode for the AR overlay.

Parameters:

ParameterTypeDescription
valuenumberRefresh mode value

getAROverlayRefresh #

TypeScript
getAROverlayRefresh()

Retrieves the AR overlay refresh mode.

setARSelectedLocationColor #

TypeScript
setARSelectedLocationColor(value: string)

Sets the overlay color for selected barcodes in AR mode.

Parameters:

ParameterTypeDescription
valuestringHex color code

getARSelectedLocationColor #

TypeScript
getARSelectedLocationColor()

Retrieves the color used for selected barcode overlays in AR mode.

setARNonSelectedLocationColor #

TypeScript
setARNonSelectedLocationColor(value: string)

Sets the overlay color for non-selected barcodes in AR mode.

Parameters:

ParameterTypeDescription
valuestringHex color code

getARNonSelectedLocationColor #

TypeScript
getARNonSelectedLocationColor()

Retrieves the color used for non-selected barcode overlays in AR mode.

setARSelectedLocationLineWidth #

TypeScript
setARSelectedLocationLineWidth(value: number)

Sets line width for selected barcode overlay.

Parameters:

ParameterTypeDescription
valuenumberWidth in pixels

getARSelectedLocationLineWidth #

TypeScript
getARSelectedLocationLineWidth()

Retrieves the line width for selected barcode overlays in AR mode.

setARNonSelectedLocationLineWidth #

TypeScript
setARNonSelectedLocationLineWidth(value: number)

Sets line width for non-selected barcode overlay.

Parameters:

ParameterTypeDescription
valuenumberWidth in pixels

getARNonSelectedLocationLineWidth #

TypeScript
getARNonSelectedLocationLineWidth()

Retrieves the line width for non-selected barcode overlays in AR mode.

setARLocationType #

TypeScript
setARLocationType(value: number)

Sets AR location style (tight, bounding box, none).

Parameters:

ParameterTypeDescription
valuenumberLocation type

getARLocationType #

TypeScript
getARLocationType()

Retrieves the style of AR location overlays (tight, bounding box, none).

setARDoubleTapToFreezeEnabled #

TypeScript
setARDoubleTapToFreezeEnabled(enabled: boolean)

Enables or disables double-tap to freeze scanning in AR mode.

Parameters:

ParameterTypeDescription
enabledbooleanBoolean toggle

isARDoubleTapToFreezeEnabled #

TypeScript
isARDoubleTapToFreezeEnabled()

Checks whether double-tap to freeze is enabled in AR mode.

setARImageResultEnabled #

TypeScript
setARImageResultEnabled(enabled: boolean)

Enables or disables the capturing and processing of image data when a barcode is selected for AR mode.

Parameters:

ParameterTypeDescription
enabledbooleanBoolean toggle

isARImageResultEnabled #

TypeScript
isARImageResultEnabled()

Retrieves whether image result is enabled for AR mode.

setARBarcodeThumbnailOnResultEnabled #

TypeScript
setARBarcodeThumbnailOnResultEnabled(enabled: boolean)

Enables or disables the barcode thumbnail on result for AR mode.

Parameters:

ParameterTypeDescription
enabledbooleanBoolean toggle

isARBarcodeThumbnailOnResultEnabled #

TypeScript
isARBarcodeThumbnailOnResultEnabled()

Retrieves whether barcode thumbnail on result is enabled for AR mode.

setARResultLimit #

TypeScript
setARResultLimit(value: number)

Sets the maximum number of results allowed in a single AR scanning session.

Parameters:

ParameterTypeDescription
valuenumberMaximum results limit

getARResultLimit #

TypeScript
getARResultLimit()

Retrieves the maximum number of results allowed in a single AR scanning session.

setARContinueScanningOnLimit #

TypeScript
setARContinueScanningOnLimit(value: boolean)

Sets whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).

Parameters:

ParameterTypeDescription
valuebooleanBoolean toggle

getARContinueScanningOnLimit #

TypeScript
getARContinueScanningOnLimit()

Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).

setAREmitResultsAtSessionEndOnly #

TypeScript
setAREmitResultsAtSessionEndOnly(value: boolean)

Sets whether results are emitted only at AR session end (or when the limit is reached).

Parameters:

ParameterTypeDescription
valuebooleanBoolean toggle

getAREmitResultsAtSessionEndOnly #

TypeScript
getAREmitResultsAtSessionEndOnly()

Retrieves whether results are emitted only at AR session end (or when the limit is reached).

setARHeaderHeight #

TypeScript
setARHeaderHeight(value: number)

Sets height of header label above barcode in AR mode.

Parameters:

ParameterTypeDescription
valuenumberHeight in pixels

getARHeaderHeight #

TypeScript
getARHeaderHeight()

Retrieves the header height above barcode in AR mode.

setARHeaderShowMode #

TypeScript
setARHeaderShowMode(value: number)

Sets header visibility condition (always, on selected, never).

Parameters:

ParameterTypeDescription
valuenumberShow mode

getARHeaderShowMode #

TypeScript
getARHeaderShowMode()

Retrieves the header display mode (always, on selected, never).

setARHeaderMaxTextHeight #

TypeScript
setARHeaderMaxTextHeight(value: number)

Sets max text height for AR header.

Parameters:

ParameterTypeDescription
valuenumberMax height in pixels

getARHeaderMaxTextHeight #

TypeScript
getARHeaderMaxTextHeight()

Retrieves the maximum text height for AR headers.

setARHeaderMinTextHeight #

TypeScript
setARHeaderMinTextHeight(value: number)

Sets min text height for AR header.

Parameters:

ParameterTypeDescription
valuenumberMin height in pixels

getARHeaderMinTextHeight #

TypeScript
getARHeaderMinTextHeight()

Retrieves the minimum text height for AR headers.

setARHeaderTextColorSelected #

TypeScript
setARHeaderTextColorSelected(value: string)

Sets text color for selected barcode header.

Parameters:

ParameterTypeDescription
valuestringHex color code

getARHeaderTextColorSelected #

TypeScript
getARHeaderTextColorSelected()

Retrieves the header text color for selected barcodes.

setARHeaderTextColorNonSelected #

TypeScript
setARHeaderTextColorNonSelected(value: string)

Sets text color for non-selected barcode header.

Parameters:

ParameterTypeDescription
valuestringHex color code

getARHeaderTextColorNonSelected #

TypeScript
getARHeaderTextColorNonSelected()

Retrieves the header text color for non-selected barcodes.

setARHeaderHorizontalTextMargin #

TypeScript
setARHeaderHorizontalTextMargin(value: number)

Sets the horizontal margin applied to the header text in AR mode, creating equal padding on both sides.

Parameters:

ParameterTypeDescription
valuenumberMargin in pixels

getARHeaderHorizontalTextMargin #

TypeScript
getARHeaderHorizontalTextMargin()

Retrieves the horizontal margin for AR header text.

setARHeaderVerticalTextMargin #

TypeScript
setARHeaderVerticalTextMargin(value: number)

Sets the vertical margin applied to the header text in AR mode, creating equal padding on both sides.

Parameters:

ParameterTypeDescription
valuenumberMargin in pixels

getARHeaderVerticalTextMargin #

TypeScript
getARHeaderVerticalTextMargin()

Retrieves the vertical margin for AR header text.

setARHeaderTextFormat #

TypeScript
setARHeaderTextFormat(value: string)

Sets AR header text format using placeholders.

Parameters:

ParameterTypeDescription
valuestringFormat string (e.g., \[barcode\_text\])

getARHeaderTextFormat #

TypeScript
getARHeaderTextFormat()

Retrieves the format string used for AR header text.

resetARCache #

TypeScript
resetARCache()

Clears all cached barcode results from the current AR scanning session.

On-screen buttons #

configureCloseButton #

TypeScript
configureCloseButton(   visible: boolean,   positionX: number,   positionY: number,   iconSize: number,   tintColor: string,   backgroundColor: string,   cornerRadius: number,   padding: number,   useCustomIcon: boolean,   customIcon: string )

Configures the close button displayed during scanning.

To perform an action when the button is tapped, listen for the barkoderCloseButtonTappedEvent

Parameters:

ParameterTypeDescription
visiblebooleanShow the button while scanning
positionXnumberX position in points
positionYnumberY position in points
iconSizenumberGlyph point size
tintColorstringIcon tint. Hex string (e.g., "#3472c9"). Leave empty to use default
backgroundColorstringButton background. Hex string. Leave empty to use default
cornerRadiusnumberCorner radius
paddingnumberInner padding around the glyph
useCustomIconbooleanSet true to use a provided custom icon
customIconstringCustom icon for the button as a Base64-encoded image string

configureFlashButton #

TypeScript
configureFlashButton(   visible: boolean,   positionX: number,   positionY: number,   iconSize: number,   tintColor: string,   backgroundColor: string,   cornerRadius: number,   padding: number,   useCustomIcon: boolean,   customIconFlashOn: string,   customIconFlashOff: string )

Configures the flash (torch) button. Auto-hides if torch is unavailable.

Parameters:

ParameterTypeDescription
visiblebooleanShow the button while scanning
positionXnumberX position in points
positionYnumberY position in points
iconSizenumberGlyph point size
tintColorstringIcon tint. Hex string (e.g., "#3472c9"). Leave empty to use default
backgroundColorstringButton background. Hex string. Leave empty to use default
cornerRadiusnumberCorner radius
paddingnumberInner padding around the glyph
useCustomIconbooleanSet true to use provided custom icons
customIconFlashOnstringCustom icon for the ON state as a Base64-encoded image string
customIconFlashOffstringCustom icon for the OFF state as a Base64-encoded image string

configureZoomButton #

TypeScript
configureZoomButton(   visible: boolean,   positionX: number,   positionY: number,   iconSize: number,   tintColor: string,   backgroundColor: string,   cornerRadius: number,   padding: number,   useCustomIcon: boolean,   customIconZoomedIn: string,   customIconZoomedOut: string,   zoomedInFactor: number,   zoomedOutFactor: number )

Configures the zoom button.

Parameters:

ParameterTypeDescription
visiblebooleanShow the button while scanning
positionXnumberX position in points
positionYnumberY position in points
iconSizenumberGlyph point size
tintColorstringIcon tint. Hex string (e.g., "#3472c9"). Leave empty to use default
backgroundColorstringButton background. Hex string. Leave empty to use default
cornerRadiusnumberCorner radius
paddingnumberInner padding around the glyph
useCustomIconbooleanSet true to use provided custom icons
customIconZoomedInstringCustom icon for the zoomed-in state as a Base64-encoded image string
customIconZoomedOutstringCustom icon for the zoomed-out state as a Base64-encoded image string
zoomedInFactornumberZoom factor when toggled in
zoomedOutFactornumberZoom factor when toggled out

Result models #

Scan callbacks return plain objects. Use new BarkoderResult(data) to create the result models below. ? marks an optional property; its fallback value is listed where applicable.

Raw Scan Result #

The object received by the startScanning or scanImage success callback. Images contain JPEG Base64 without a data URL prefix.

PropertyTypeDescription
decoderResultsraw decoder result arrayDecoded barcodes; may be empty.
resultThumbnailsAsBase64?Array of string or nullAvailable barcode thumbnails. May be empty or contain null entries. A matching index for each decoder result is not guaranteed.
resultImageAsBase64?stringResult image, when available.

Raw Decoder Result #

PropertyTypeDescription
barcodeTypenumberNative barcode-type identifier.
barcodeTypeName?string or nullBarcode-type name, when available.
binaryDataAsBase64?stringBarcode bytes encoded as Base64, not an image.
textualData?string or nullDecoded barcode text, when available.
characterSet?string or nullCharacter encoding, when available.
extra?stringAdditional decoded data as JSON text.
isMatchedbooleanMatch status for the configured match filter.
mrzImagesAsBase64?Array of { name: string; base64?: string }Available images for MRZ results. May be empty; image names and encoded content are not guaranteed.
sadlImageAsBase64?stringSADL image extracted from extra data, when available.
locationPoints?{ x: number; y: number }[]Available barcode location points. Coordinates are forwarded unchanged; point count and order are not guaranteed.

BarkoderResult #

TypeScript
new BarkoderResult(resultMap: Record<string, any>)

Wraps the callback data and creates a DecoderResult for each decoded barcode.

PropertyTypeDescription
decoderResultsDecoderResult[]Decoded barcodes. Defaults to [] if the input is not an array.
resultThumbnailsAsBase64?string[] or nullJPEG data URLs, with empty or null entries removed. An empty array remains []; missing or non-array input becomes null.
resultImageAsBase64?string or nullJPEG data URL, or null when missing or empty.

Image values are prefixed with data:image/jpeg;base64,. Construct this model from raw callback data only; existing prefixes are not detected.

DecoderResult #

TypeScript
new DecoderResult(resultMap: Record<string, any>)
PropertyTypeDescription
barcodeTypenumberNative barcode-type identifier; not declared as the BarcodeType enum.
barcodeTypeNamestringBarcode-type name.
binaryDataAsBase64stringBarcode bytes as Base64, unchanged.
textualDatastringDecoded barcode text.
characterSet?string or nullCharacter encoding, or null when missing or empty.
extra?Record<string, any> or nullParsed JSON data, or null when absent. Invalid JSON throws during construction; the parsed shape is not validated.
mrzImagesAsBase64?{ name: string; base64: string }[]Named MRZ images with JPEG data URLs. Defaults to [] if the input is missing or not an array. Image content is not validated.
sadlImageAsBase64?string or nullSADL image as a JPEG data URL, or null when missing or empty.
locationPoints?{ x: number; y: number }[]Original location-point array, or undefined when unavailable.
isMatchedbooleanMatch status from the decoded result.

The types above are the helper's declared types. Directly copied fields have no fallback: missing values remain undefined, and null values remain null. MRZ image entries are not filtered; a missing or null encoding produces a data URL ending in undefined or null.

Location Point Shape #

Each entry in locationPoints has these properties:

PropertyTypeDescription
xnumberHorizontal coordinate.
ynumberVertical coordinate.

MRZ Image Shape #

Each image in the DecoderResult.mrzImagesAsBase64 array has these properties:

PropertyTypeDescription
namestringImage name.
base64stringJPEG data URL. Raw callback entries contain bare Base64 and may omit this field.

Callbacks & events #

TypeScript
Barkoder.startScanning(success, error);
Barkoder.scanImage(base64, success, error);

The success callback receives a raw scan result. Convert it with new BarkoderResult(data), as shown below. Use startScanning and scanImage separately; they share the same result callback.

Set closeSessionOnResultEnabled to false to receive further results without closing the session. Call stopScanning() to stop scanning.

For scanImage, pass the image's Base64 content without the data URL prefix. Initialize the scanner first and supply a valid image; invalid input may not invoke an error callback.

captureImage requests a frame; its completion callback does not return the image. Available image data arrives through the scan-result callback. Enable setImageResultEnabled(true) or setBarcodeThumbnailOnResultEnabled(true) to request images or thumbnails. AR scanning uses the corresponding setARImageResultEnabled and setARBarcodeThumbnailOnResultEnabled settings. Images may still be absent.

Result Example #

Run after the platform is ready, the license key is registered, and the scanner is initialized with the required barcode types enabled.

TypeScript
import { BarkoderResult } from 'plugins/barkoder-cordova-plugin/www/BarkoderConfig';

declare var Barkoder: any;

Barkoder.startScanning((data: any) => {
	const barkoderResult = new BarkoderResult(data);
	barkoderResult.decoderResults.forEach((result) => {
		console.log(result.barcodeTypeName, result.textualData);
	});
}, (err: any) => {
	console.error(err);
});

barkoderCloseButtonTappedEvent #

Use this event only when handling taps on the button configured with configureCloseButton(...). It has no custom payload. Register after the platform is ready and remove the handler when the view is disposed.

TypeScript
declare const Barkoder: any;

function onCloseButtonTapped(): void {
	Barkoder.stopScanning();
}

document.addEventListener('barkoderCloseButtonTappedEvent', onCloseButtonTapped);

function removeCloseButtonListener(): void {
	document.removeEventListener('barkoderCloseButtonTappedEvent', onCloseButtonTapped);
}

Call removeCloseButtonListener() when disposing the view.

Enums #

These are the complete exported enums from the TypeScript helper module. Import them from plugins/barkoder-cordova-plugin/www/BarkoderConfig. Members are numeric; names and capitalization below are the public TypeScript spellings. For example, BarkoderCameraPosition.FRONT is 1. Native SDK names are not the JavaScript member names.

DecodingSpeed #

Used by setDecodingSpeed and returned through the success callback of getDecodingSpeed.

MemberValue
fast0
normal1
slow2
rigorous3

FormattingType #

Used by setFormattingType and returned through the success callback of getFormattingType.

MemberValue
disabled0
automatic1
gs12
aamva3
sadl4
bcbp5

MsiChecksumType #

Used by setMsiChecksumType and returned through the success callback of getMsiChecksumType.

MemberValue
disabled0
mod101
mod112
mod10103
mod11104
mod11IBM5
mod1110IBM6

Code39ChecksumType #

Used by setCode39ChecksumType and returned through the success callback of getCode39ChecksumType.

MemberValue
disabled0
enabled1

Code11ChecksumType #

Used by setCode11ChecksumType and returned through the success callback of getCode11ChecksumType.

MemberValue
disabled0
single1
double2

BarkoderCameraPosition #

Used by setCamera.

MemberValue
BACK0
FRONT1

BarkoderResolution #

Used by setBarkoderResolution and returned through the success callback of getBarkoderResolution.

MemberValue
HD0
FHD1
UHD2

BarkoderRoiCenterMark #

Used by setRoiCenterMark and returned through the success callback of getRoiCenterMark.

MemberValue
none0
crosshair1
point2

BarcodeType #

Used as the type argument of setBarcodeTypeEnabled, isBarcodeTypeEnabled, setBarcodeTypeLengthRange, and getBarcodeTypeLengthRange. Listing a type does not mean every operation supports it, such as length-range configuration for every decoder. The result model's barcodeType is a native result identifier, not a property declared with this enum type; use barcodeTypeName for the returned name.

MemberValue
aztec0
aztecCompact1
qr2
qrMicro3
code1284
code935
code396
codabar7
code118
msi9
upcA10
upcE11
upcE112
ean1313
ean814
pdf41715
pdf417Micro16
datamatrix17
code2518
interleaved2519
itf1420
iata2521
matrix2522
datalogic2523
coop2524
code3225
telepen26
dotcode27
idDocument28
databar1429
databarLimited30
databarExpanded31
postalIMB32
postnet33
planet34
australianPost35
royalMail36
kix37
japanesePost38
maxiCode39
ocrText40

BarkoderARMode #

Used by setARMode and returned through the success callback of getARMode.

MemberValue
off0
interactiveDisabled1
interactiveEnabled2
nonInteractive3
matchFilter4

BarkoderAROverlayRefresh #

Used by setAROverlayRefresh and returned through the success callback of getAROverlayRefresh.

MemberValue
smooth0
normal1

BarkoderARLocationType #

Used by setARLocationType and returned through the success callback of getARLocationType.

MemberValue
none0
tight1
boundingBox2

BarkoderARHeaderShowMode #

Used by setARHeaderShowMode and returned through the success callback of getARHeaderShowMode.

MemberValue
never0
always1
onSelected2

IdDocumentMasterChecksumType #

Used by the TypeScript IdDocumentBarcodeConfig.masterChecksum property.

MemberValue
disabled0
enabled1