Socket
Book a DemoInstallSign in
Socket

@capacitor/barcode-scanner

Package Overview
Dependencies
Maintainers
17
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/barcode-scanner

Capacitor plugin using Outsystems Barcode libs

latest
npmnpm
Version
2.1.0
Version published
Weekly downloads
14K
7.35%
Maintainers
17
Weekly downloads
 
Created
Source

@capacitor/barcode-scanner

Capacitor plugin using Outsystems Barcode libs

Install

npm install @capacitor/barcode-scanner
npx cap sync

Android

The barcode scanner plugin requires a minimum Android SDK target of 26. This is higher than the default that comes with your Capacitor application. You can update this value in your android/variables.gradle file.

ext {
    minSdkVersion = 26
}

Note: Android with ZXING scanning library supports all formats, while MLKIT supports all but MAXICODE, RSS_14, RSS_EXPANDED and UPC_EAN_EXTENSION - using one of these in hint will default to scanning any format.

iOS

The barcode scanner uses the camera on the device. Ensure you configure the Privacy - Camera Usage Description in your Info.plist file so that your application can access the device's camera.

Note: iOS supports all formats but MAXICODE and UPC_EAN_EXTENSION - using them in hint will default to scanning any format. Also, Apple Vision does not distinguish between UPC_A and EAN_13, so specifying one of these in hint will allow to scan both.

API

  • scanBarcode(...)
  • Type Aliases
  • Enums

Interface defining the contract for a plugin capable of scanning barcodes. Requires implementation of the scanBarcode method, which initiates a barcode scan with given options.

scanBarcode(...)

scanBarcode(options: CapacitorBarcodeScannerOptions) => Promise<CapacitorBarcodeScannerScanResult>
ParamType
optionsCapacitorBarcodeScannerOptions

Returns: Promise<CapacitorBarcodeScannerScanResult>

Type Aliases

CapacitorBarcodeScannerScanResult

Defines the structure of the result returned from a barcode scan.

{ ScanResult: string; format: CapacitorBarcodeScannerTypeHint; }

CapacitorBarcodeScannerTypeHint

Extends supported formats from Html5Qrcode with a special 'ALL' option, indicating support for all barcode types. Type definition combining Html5QrcodeSupportedFormats and OSBarcodeTypeHintALLOption to represent the hint for the type of barcode to be scanned.

Html5QrcodeSupportedFormats | CapacitorBarcodeScannerTypeHintALLOption

CapacitorBarcodeScannerOptions

Defines the options for configuring a barcode scan.

{ hint: CapacitorBarcodeScannerTypeHint; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: CapacitorBarcodeScannerCameraDirection; scanOrientation?: CapacitorBarcodeScannerScanOrientation; android?: { scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }

Enums

Html5QrcodeSupportedFormats

MembersValue
QR_CODE0
AZTEC1
CODABAR2
CODE_393
CODE_934
CODE_1285
DATA_MATRIX6
MAXICODE7
ITF8
EAN_139
EAN_810
PDF_41711
RSS_1412
RSS_EXPANDED13
UPC_A14
UPC_E15
UPC_EAN_EXTENSION16

CapacitorBarcodeScannerTypeHintALLOption

MembersValue
ALL17

CapacitorBarcodeScannerCameraDirection

MembersValue
BACK1
FRONT2

CapacitorBarcodeScannerScanOrientation

MembersValue
PORTRAIT1
LANDSCAPE2
ADAPTIVE3

CapacitorBarcodeScannerAndroidScanningLibrary

MembersValue
ZXING'zxing'
MLKIT'mlkit'

Keywords

capacitor

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts