@tauri-apps/plugin-barcode-scanner
Scan QR codes, EAN-13 and other kinds of barcodes with the device’s camera on Android and iOS.
Enumerations
Section titled “Enumerations”Format
Section titled “Format”The barcode symbologies that can be scanned, or used to restrict a scan via ScanOptions.formats.
Enumeration Members
Section titled “Enumeration Members”Aztec: "AZTEC";Aztec code, a two-dimensional matrix barcode often used on tickets and boarding passes.
Codabar
Section titled “Codabar”Codabar: "CODABAR";Codabar, a numeric barcode commonly used by libraries and blood banks.
Not supported on iOS.
Code128
Section titled “Code128”Code128: "CODE_128";Code 128, a high-density alphanumeric barcode used in shipping and packaging.
Code39
Section titled “Code39”Code39: "CODE_39";Code 39, an alphanumeric barcode used in logistics and inventory tracking.
Code93
Section titled “Code93”Code93: "CODE_93";Code 93, a compact alphanumeric barcode similar to Code 39.
DataMatrix
Section titled “DataMatrix”DataMatrix: "DATA_MATRIX";Data Matrix, a two-dimensional matrix barcode used to encode small amounts of data.
EAN13: "EAN_13";EAN-13, a 13-digit numeric barcode used worldwide on retail products.
EAN8: "EAN_8";EAN-8, an 8-digit numeric barcode used on small retail packaging.
GS1DataBar
Section titled “GS1DataBar”GS1DataBar: "GS1_DATA_BAR";GS1 DataBar, a compact barcode used to mark variable-measure items such as fresh food.
Not supported on Android. Requires iOS 15.4+
GS1DataBarExpanded
Section titled “GS1DataBarExpanded”GS1DataBarExpanded: "GS1_DATA_BAR_EXPANDED";The expanded variant of Format.GS1DataBar, capable of encoding additional data such as weight.
Not supported on Android. Requires iOS 15.4+
GS1DataBarLimited
Section titled “GS1DataBarLimited”GS1DataBarLimited: "GS1_DATA_BAR_LIMITED";The limited variant of Format.GS1DataBar, encoding fewer digits in a smaller symbol.
Not supported on Android. Requires iOS 15.4+
ITF: "ITF";ITF (Interleaved 2 of 5), a numeric barcode encoding an even number of digits.
PDF417
Section titled “PDF417”PDF417: "PDF_417";PDF417, a stacked linear barcode used on IDs, boarding passes and shipping labels.
QRCode
Section titled “QRCode”QRCode: "QR_CODE";QR code, a two-dimensional matrix barcode.
UPC_A: "UPC_A";UPC-A, a 12-digit numeric barcode commonly used on retail products in North America.
Not supported on iOS.
UPC_E: "UPC_E";UPC-E, a compressed 6-digit variant of UPC-A used on small packaging.
Interfaces
Section titled “Interfaces”Scanned
Section titled “Scanned”The result of a successful scan call.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
bounds |
unknown |
The bounding box of the scanned barcode within the camera frame, when reported by the platform. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L132 |
content |
string |
The decoded content of the barcode. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L124 |
format |
Format |
The format of the scanned barcode. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L128 |
ScanOptions
Section titled “ScanOptions”Options to configure a scan call.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
cameraDirection? |
"back" | "front" |
Which camera to use for scanning. Defaults to back. |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L106 |
formats? |
Format[] |
The barcode formats to scan for. Defaults to all supported formats. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L110 |
windowed? |
boolean |
Whether to show the camera in a small window instead of taking over the whole screen. Defaults to false. |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L114 |
Type Aliases
Section titled “Type Aliases”PermissionState
Section titled “PermissionState”type PermissionState = "granted" | "denied" | "prompt" | "prompt-with-rationale";Source: undefined
Functions
Section titled “Functions”cancel()
Section titled “cancel()”function cancel(): Promise<void>;Cancel the current scan process.
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-barcode-scanner';
await cancel();2.0.0
checkPermissions()
Section titled “checkPermissions()”function checkPermissions(): Promise<PermissionState>;Get the current state of the camera permission.
Returns
Section titled “Returns”Promise<PermissionState>
A promise resolving to the current state of the camera permission.
Example
Section titled “Example”import { checkPermissions } from '@tauri-apps/plugin-barcode-scanner';
const permissionState = await checkPermissions();2.0.0
openAppSettings()
Section titled “openAppSettings()”function openAppSettings(): Promise<void>;Open application settings. Useful if permission was denied and the user must manually enable it.
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { openAppSettings } from '@tauri-apps/plugin-barcode-scanner';
await openAppSettings();2.0.0
requestPermissions()
Section titled “requestPermissions()”function requestPermissions(): Promise<PermissionState>;Request permissions to use the camera.
Returns
Section titled “Returns”Promise<PermissionState>
A promise resolving to the new state of the camera permission.
Example
Section titled “Example”import { requestPermissions } from '@tauri-apps/plugin-barcode-scanner';
const permissionState = await requestPermissions();2.0.0
scan()
Section titled “scan()”function scan(options?): Promise<Scanned>;Start scanning, opening the device’s camera. The returned promise resolves once a barcode matching the given options has been scanned, or rejects if the scan is cancelled.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options? |
ScanOptions |
Configuration for the scan. |
Returns
Section titled “Returns”A promise resolving to the scanned barcode.
Example
Section titled “Example”import { scan, Format } from '@tauri-apps/plugin-barcode-scanner';
const scanned = await scan({ windowed: true, formats: [Format.QRCode] });2.0.0
© 2026 Tauri Contributors. CC-BY / MIT