Capgo's Zebra DataWedge plugin brings Zebra's Android barcode and RFID capture APIs to Capacitor.
It is designed as an open alternative to Ionic's enterprise Zebra Scanner offering and exposes the same high-level groups:
ZebraConfiguration for profile management
ZebraNotification for scanner/profile status notifications
ZebraQuery for profile, scanner, and DataWedge queries
ZebraRuntime for enabling/disabling scanners and triggering scans
The complete documentation is published here: https://capgo.app/docs/plugins/zebra-datawedge/
| Plugin version | Capacitor compatibility | Maintained |
|---|
v8.*.* | v8.*.* | ✅ |
This plugin is Android-only in practice because Zebra DataWedge itself runs on Zebra Android devices.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-zebra-datawedge` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-zebra-datawedge
bunx cap sync
Configure a DataWedge profile on the Zebra device before scanning:
- Associate the profile with your app.
- Enable
Intent Output.
- Set
Intent delivery to Broadcast Intent.
- Choose an intent action such as
app.capgo.zebra.SCAN.
import {
DataWedgeConfigMode,
DataWedgePlugin,
ZebraConfiguration,
ZebraDataWedge,
ZebraRuntime,
} from '@capgo/capacitor-zebra-datawedge';
const intentAction = 'app.capgo.zebra.SCAN';
await ZebraConfiguration.setConfig({
profileName: 'CapgoZebraProfile',
profileEnabled: true,
configMode: DataWedgeConfigMode.CREATE_IF_NOT_EXIST,
appList: [
{
packageName: 'com.example.app',
activityList: ['*'],
},
],
pluginConfigs: [
{
pluginName: DataWedgePlugin.BARCODE,
resetConfig: true,
paramList: {
scanner_selection: 'auto',
scanner_input_enabled: 'true',
},
},
{
pluginName: DataWedgePlugin.INTENT,
resetConfig: true,
paramList: {
intent_output_enabled: 'true',
intent_action: intentAction,
intent_delivery: 2,
},
},
],
});
await ZebraDataWedge.addListener('scan', (result) => {
console.log('Scanned', result.data, result.labelType);
});
const result = await ZebraRuntime.softScanTrigger(intentAction);
console.log(result);
- Query and configuration APIs depend on Zebra DataWedge being installed and enabled.
softScanTrigger() waits for the next scan broadcast on the intent action you provide.
softRfidTrigger() uses the first registered scan intent action. Register a scan action first if you need RFID reads.
- Web and iOS return "not available" errors for all DataWedge operations.
cloneProfile(options: CloneProfileOptions) => Promise<void>
createProfile(options: CreateProfileOptions) => Promise<void>
deleteProfile(options: DeleteProfileOptions) => Promise<void>
importConfig(options: ImportConfigOptions) => Promise<void>
renameProfile(options: RenameProfileOptions) => Promise<void>
restoreConfig() => Promise<void>
setConfig(options: SetConfigOptions) => Promise<void>
setDisabledAppList(options: SetDisabledAppListOptions) => Promise<void>
setIgnoreDisabledProfiles(options: IgnoreDisabledProfilesResult) => Promise<void>
registerForNotification(options: Omit<RegisterForNotificationOptions, 'callback'>) => Promise<void>
unRegisterForNotification(options: Omit<RegisterForNotificationOptions, 'callback'>) => Promise<void>
enumerateScanners() => Promise<{ scanners: ZebraDeviceScanner[]; }>
Returns: Promise<{ scanners: ZebraDeviceScanner[]; }>
getActiveProfile() => Promise<{ profileName: string; }>
Returns: Promise<{ profileName: string; }>
getAssociatedApps(options: { profileName: string; }) => Promise<{ appList: DataWedgeAppConfig[]; }>
| Param | Type |
|---|
options | { profileName: string; } |
Returns: Promise<{ appList: DataWedgeAppConfig[]; }>
getConfig(options: GetConfigOptions) => Promise<ZebraProfileConfiguration>
Returns: Promise<ZebraProfileConfiguration>
getDatawedgeStatus() => Promise<DataWedgeStatusResult>
Returns: Promise<DataWedgeStatusResult>
getDisabledAppList() => Promise<{ appList: DataWedgeAppConfig[]; }>
Returns: Promise<{ appList: DataWedgeAppConfig[]; }>
getIgnoreDisabledProfiles() => Promise<IgnoreDisabledProfilesResult>
Returns: Promise<IgnoreDisabledProfilesResult>
getProfilesList() => Promise<{ profiles: string[]; }>
Returns: Promise<{ profiles: string[]; }>
getScannerStatus() => Promise<{ status: ScannerStatus | string; }>
Returns: Promise<{ status: string; }>
getVersionInfo() => Promise<ZebraDeviceVersionInfo>
Returns: Promise<ZebraDeviceVersionInfo>
disableDatawedge() => Promise<void>
disableScannerInput() => Promise<void>
enableDatawedge() => Promise<void>
enableScannerInput() => Promise<void>
enumerateTriggers() => Promise<{ triggers: string[]; }>
Returns: Promise<{ triggers: string[]; }>
notify(options: DataWedgeNotifyOptions) => Promise<void>
resetDefaultProfile() => Promise<void>
setDefaultProfile(options: { profileName: string; }) => Promise<void>
| Param | Type |
|---|
options | { profileName: string; } |
setReportingOptions(options: ReportingOptions) => Promise<void>
softRfidTrigger() => Promise<ZebraScanResult>
Returns: Promise<ZebraScanResult>
softScanTrigger(options: { intentAction: string; }) => Promise<ZebraScanResult>
| Param | Type |
|---|
options | { intentAction: string; } |
Returns: Promise<ZebraScanResult>
switchScanner(options: { scannerIndex?: string; scannerIdentifier?: ScannerIdentifier; }) => Promise<void>
switchScannerParams(options: SwitchScannerParamsOptions) => Promise<void>
switchToProfile(options: { profileName: string; }) => Promise<void>
| Param | Type |
|---|
options | { profileName: string; } |
getPluginVersion() => Promise<PluginVersionResult>
Returns: Promise<PluginVersionResult>
addListener(eventName: 'scan', listenerFunc: (event: ZebraScanResult) => void) => Promise<PluginListenerHandle>
Returns: Promise<PluginListenerHandle>
addListener(eventName: 'notification', listenerFunc: (event: ZebraNotificationEvent) => void) => Promise<PluginListenerHandle>
Returns: Promise<PluginListenerHandle>
| Prop | Type |
|---|
destProfileName | string |
sourceProfileName | string |
| Prop | Type |
|---|
profileName | string |
| Prop | Type |
|---|
profileNames | string[] |
| Prop | Type |
|---|
fileList | string[] |
folderPath | string |
| Prop | Type |
|---|
currentProfileName | string |
newProfileName | string |
| Prop | Type |
|---|
appList | DataWedgeAppConfig[] |
configMode | DataWedgeConfigMode |
pluginConfigs | DataWedgePluginConfig[] |
profileEnabled | boolean |
profileName | string |
| Prop | Type |
|---|
activityList | string[] |
packageName | string |
| Prop | Type |
|---|
notificationType | string |
profileName | string |
scannerStatus | string |
status | string |
raw | Record<string, unknown> |
| Prop | Type |
|---|
connectionState | boolean |
id | string |
index | number |
name | string |
| Prop | Type |
|---|
appList | DataWedgeAppConfig[] |
pluginConfigList | DataWedgePluginConfig[] |
profileEnabled | boolean |
profileName | string |
| Prop | Type |
|---|
pluginConfigs | PluginConfigOptions[] |
profileName | string |
| Prop | Type |
|---|
barcodeVersion | string |
dataWedgeVersion | string |
decoderVersion | string |
scannerFirmwareVersions | string[] |
simulScanVersion | string |
| Prop | Type |
|---|
deviceIdentifier | string |
notificationSettings | number[] |
| Prop | Type |
|---|
reportingEnabled | boolean |
reportingGenerateOption | 'manual' | 'auto' | 'both' |
reportingShowForManualImport | boolean |
| Prop | Type |
|---|
data | string |
decodedMode | string |
intentAction | string |
labelType | string |
source | string |
| Prop | Type |
|---|
remove | () => Promise<void> |
Construct a type with the properties of T except for those in type K.
Pick<T, Exclude<keyof T, K>>
From T, pick a set of properties whose keys are in the union K
{
[P in K]: T[P];
}
Exclude from T those types that are assignable to U
T extends U ? never : T
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
| Members | Value |
|---|
CREATE_IF_NOT_EXIST | 'CREATE_IF_NOT_EXIST' |
OVERWRITE | 'OVERWRITE' |
REMOVE | 'REMOVE' |
UPDATE | 'UPDATE' |
| Members | Value |
|---|
ADF | 'ADF' |
BARCODE | 'BARCODE' |
BDF | 'BDF' |
DCP | 'DCP' |
EKB | 'EKB' |
INTENT | 'INTENT' |
IP | 'IP' |
KEYSTROKE | 'KEYSTROKE' |
MSR | 'MSR' |
RFID | 'RFID' |
SERIAL | 'SERIAL' |
TOKENS | 'TOKENS' |
VOICE | 'VOICE' |
| Members | Value |
|---|
CONNECTED | 'CONNECTED' |
DISABLED | 'DISABLED' |
DISCONNECTED | 'DISCONNECTED' |
IDLE | 'IDLE' |
SCANNING | 'SCANNING' |
WAITING | 'WAITING' |
| Members | Value |
|---|
CONFIGURATION_UPDATE | 'CONFIGURATION_UPDATE' |
PROFILE_SWITCH | 'PROFILE_SWITCH' |
SCANNER_STATUS | 'SCANNER_STATUS' |
| Members | Value |
|---|
AUTO | 'AUTO' |
BLUETOOTH_DS3678 | 'BLUETOOTH_DS3678' |
BLUETOOTH_RS6000 | 'BLUETOOTH_RS6000' |
BLUETOOTH_SSI | 'BLUETOOTH_SSI' |
INTERNAL_CAMERA | 'INTERNAL_CAMERA' |
INTERNAL_IMAGER | 'INTERNAL_IMAGER' |
INTERNAL_LASER | 'INTERNAL_LASER' |
PLUGABLE_SSI | 'PLUGABLE_SSI' |
PLUGABLE_SSI_RS5000 | 'PLUGABLE_SSI_RS5000' |
SERIAL_SSI | 'SERIAL_SSI' |
USB_SSI_DS3608 | 'USB_SSI_DS3608' |