@capgo/capacitor-zebra-datawedge
v8.2.1
Published
Capacitor plugin for Zebra DataWedge profile management, notifications, queries, and soft scanning on Zebra Android devices.
Readme
@capgo/capacitor-zebra-datawedge
Scan barcodes and RFID tags on Zebra Android devices from your Capacitor app with DataWedge: manage profiles, trigger scans and receive results. An open alternative to Ionic's enterprise Zebra scanner.
🤖 Building with an AI coding agent? Install Capgo skills so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use
@capgo/capacitor-zebra-datawedgein your Capacitor app:npx skills add Cap-go/capgo-skills. Then ask your agent: "Add @capgo/capacitor-zebra-datawedge to my Capacitor app and wire it up." Agent setup guides · Hosted MCP
Key features
- Scan events: the
scanlistener delivers barcode and RFID data. - Soft scanning:
softScanTrigger()starts a scan from your UI. - Profiles:
createProfile(),cloneProfile(),renameProfile(),deleteProfile()andsetConfig(). - Queries:
enumerateScanners(),getActiveProfile(),getConfig()andgetDatawedgeStatus(). - Notifications:
registerForNotification()with thenotificationevent. - Platforms: Android. Android only, on Zebra devices with DataWedge. iOS and web return not available errors.
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:
ZebraConfigurationfor profile managementZebraNotificationfor scanner/profile status notificationsZebraQueryfor profile, scanner, and DataWedge queriesZebraRuntimefor enabling/disabling scanners and triggering scans
Documentation
The complete documentation is published here: https://capgo.app/docs/plugins/zebra-datawedge/
Compatibility
| Plugin version | Capacitor compatibility | Maintained |
| -------------- | ----------------------- | ---------- |
| v8.*.* | v8.*.* | ✅ |
This plugin is Android-only in practice because Zebra DataWedge itself runs on Zebra Android devices.
Install
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-pluginsThen 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 syncZebra setup
Configure a DataWedge profile on the Zebra device before scanning:
- Associate the profile with your app.
- Enable
Intent Output. - Set
Intent deliverytoBroadcast Intent. - Choose an intent action such as
app.capgo.zebra.SCAN.
Basic usage
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);
});
// Physical scan button: intent action is registered automatically from setConfig above.
// You can also register explicitly before listening:
// await ZebraRuntime.registerScanIntentAction(intentAction);
const result = await ZebraRuntime.softScanTrigger(intentAction);
console.log(result);Notes
- Query and configuration APIs depend on Zebra DataWedge being installed and enabled.
setConfig()registers scan intent actions fromscanIntentActionand fromINTENTpluginintent_actionvalues inpluginConfigsafter a successful update, whether or notscanIntentActionis provided.registerScanIntentAction()registers a custom intent action without callingregisterForNotification()orsoftScanTrigger(). Repeat on every app start because receiver registration is in-memory only.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.
API
cloneProfile(...)createProfile(...)deleteProfile(...)importConfig(...)renameProfile(...)restoreConfig()setConfig(...)setDisabledAppList(...)setIgnoreDisabledProfiles(...)registerForNotification(...)registerScanIntentAction(...)unRegisterForNotification(...)enumerateScanners()getActiveProfile()getAssociatedApps(...)getConfig(...)getDatawedgeStatus()getDisabledAppList()getIgnoreDisabledProfiles()getProfilesList()getScannerStatus()getVersionInfo()disableDatawedge()disableScannerInput()enableDatawedge()enableScannerInput()enumerateTriggers()notify(...)resetDefaultProfile()setDefaultProfile(...)setReportingOptions(...)softRfidTrigger()softScanTrigger(...)switchScanner(...)switchScannerParams(...)switchToProfile(...)getPluginVersion()addListener('scan', ...)addListener('notification', ...)- Interfaces
- Type Aliases
- Enums
cloneProfile(...)
cloneProfile(options: CloneProfileOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------- |
| options | CloneProfileOptions |
createProfile(...)
createProfile(options: CreateProfileOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options | CreateProfileOptions |
deleteProfile(...)
deleteProfile(options: DeleteProfileOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options | DeleteProfileOptions |
importConfig(...)
importConfig(options: ImportConfigOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------- |
| options | ImportConfigOptions |
renameProfile(...)
renameProfile(options: RenameProfileOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options | RenameProfileOptions |
restoreConfig()
restoreConfig() => Promise<void>setConfig(...)
setConfig(options: SetConfigOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | SetConfigOptions |
setDisabledAppList(...)
setDisabledAppList(options: SetDisabledAppListOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------- |
| options | SetDisabledAppListOptions |
setIgnoreDisabledProfiles(...)
setIgnoreDisabledProfiles(options: IgnoreDisabledProfilesResult) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------- |
| options | IgnoreDisabledProfilesResult |
registerForNotification(...)
registerForNotification(options: Omit<RegisterForNotificationOptions, 'callback'>) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| options | Omit<RegisterForNotificationOptions, 'callback'> |
registerScanIntentAction(...)
registerScanIntentAction(options: RegisterScanIntentActionOptions) => Promise<void>Registers a DataWedge scan broadcast intent action in the Android plugin receiver (runtime only;
call again on every app start). Use when your profile uses a custom intent_action and scans
come from the physical trigger.
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------- |
| options | RegisterScanIntentActionOptions |
unRegisterForNotification(...)
unRegisterForNotification(options: Omit<RegisterForNotificationOptions, 'callback'>) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| options | Omit<RegisterForNotificationOptions, 'callback'> |
enumerateScanners()
enumerateScanners() => Promise<{ scanners: ZebraDeviceScanner[]; }>Returns: Promise<{ scanners: ZebraDeviceScanner[]; }>
getActiveProfile()
getActiveProfile() => Promise<{ profileName: string; }>Returns: Promise<{ profileName: string; }>
getAssociatedApps(...)
getAssociatedApps(options: { profileName: string; }) => Promise<{ appList: DataWedgeAppConfig[]; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { profileName: string; } |
Returns: Promise<{ appList: DataWedgeAppConfig[]; }>
getConfig(...)
getConfig(options: GetConfigOptions) => Promise<ZebraProfileConfiguration>| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | GetConfigOptions |
Returns: Promise<ZebraProfileConfiguration>
getDatawedgeStatus()
getDatawedgeStatus() => Promise<DataWedgeStatusResult>Returns: Promise<DataWedgeStatusResult>
getDisabledAppList()
getDisabledAppList() => Promise<{ appList: DataWedgeAppConfig[]; }>Returns: Promise<{ appList: DataWedgeAppConfig[]; }>
getIgnoreDisabledProfiles()
getIgnoreDisabledProfiles() => Promise<IgnoreDisabledProfilesResult>Returns: Promise<IgnoreDisabledProfilesResult>
getProfilesList()
getProfilesList() => Promise<{ profiles: string[]; }>Returns: Promise<{ profiles: string[]; }>
getScannerStatus()
getScannerStatus() => Promise<{ status: ScannerStatus | string; }>Returns: Promise<{ status: string; }>
getVersionInfo()
getVersionInfo() => Promise<ZebraDeviceVersionInfo>Returns: Promise<ZebraDeviceVersionInfo>
disableDatawedge()
disableDatawedge() => Promise<void>disableScannerInput()
disableScannerInput() => Promise<void>enableDatawedge()
enableDatawedge() => Promise<void>enableScannerInput()
enableScannerInput() => Promise<void>enumerateTriggers()
enumerateTriggers() => Promise<{ triggers: string[]; }>Returns: Promise<{ triggers: string[]; }>
notify(...)
notify(options: DataWedgeNotifyOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options | DataWedgeNotifyOptions |
resetDefaultProfile()
resetDefaultProfile() => Promise<void>setDefaultProfile(...)
setDefaultProfile(options: { profileName: string; }) => Promise<void>| Param | Type |
| ------------- | ------------------------------------- |
| options | { profileName: string; } |
setReportingOptions(...)
setReportingOptions(options: ReportingOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | ReportingOptions |
softRfidTrigger()
softRfidTrigger() => Promise<ZebraScanResult>Returns: Promise<ZebraScanResult>
softScanTrigger(...)
softScanTrigger(options: { intentAction: string; }) => Promise<ZebraScanResult>| Param | Type |
| ------------- | -------------------------------------- |
| options | { intentAction: string; } |
Returns: Promise<ZebraScanResult>
switchScanner(...)
switchScanner(options: { scannerIndex?: string; scannerIdentifier?: ScannerIdentifier; }) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------- |
| options | { scannerIndex?: string; scannerIdentifier?: ScannerIdentifier; } |
switchScannerParams(...)
switchScannerParams(options: SwitchScannerParamsOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------------------------------------- |
| options | SwitchScannerParamsOptions |
switchToProfile(...)
switchToProfile(options: { profileName: string; }) => Promise<void>| Param | Type |
| ------------- | ------------------------------------- |
| options | { profileName: string; } |
getPluginVersion()
getPluginVersion() => Promise<PluginVersionResult>Returns: Promise<PluginVersionResult>
addListener('scan', ...)
addListener(eventName: 'scan', listenerFunc: (event: ZebraScanResult) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ------------------------------------------------------------------------------- |
| eventName | 'scan' |
| listenerFunc | (event: ZebraScanResult) => void |
Returns: Promise<PluginListenerHandle>
addListener('notification', ...)
addListener(eventName: 'notification', listenerFunc: (event: ZebraNotificationEvent) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------- |
| eventName | 'notification' |
| listenerFunc | (event: ZebraNotificationEvent) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
CloneProfileOptions
| Prop | Type |
| ----------------------- | ------------------- |
| destProfileName | string |
| sourceProfileName | string |
CreateProfileOptions
| Prop | Type |
| ----------------- | ------------------- |
| profileName | string |
DeleteProfileOptions
| Prop | Type |
| ------------------ | --------------------- |
| profileNames | string[] |
ImportConfigOptions
| Prop | Type |
| ---------------- | --------------------- |
| fileList | string[] |
| folderPath | string |
RenameProfileOptions
| Prop | Type |
| ------------------------ | ------------------- |
| currentProfileName | string |
| newProfileName | string |
SetConfigOptions
| Prop | Type | Description |
| ---------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appList | DataWedgeAppConfig[] | |
| configMode | DataWedgeConfigMode | |
| pluginConfigs | DataWedgePluginConfig[] | |
| profileEnabled | boolean | |
| profileName | string | |
| scanIntentAction | string | Registers this intent action in the plugin receiver after a successful setConfig (runtime only; call again on every app start). INTENT entries in pluginConfigs also register their intent_action values automatically after a successful setConfig, whether or not scanIntentAction is supplied. |
DataWedgeAppConfig
| Prop | Type |
| ------------------ | --------------------- |
| activityList | string[] |
| packageName | string |
DataWedgePluginConfig
| Prop | Type |
| ---------------------- | ------------------------------------------------------------------------------- |
| outputPluginName | DataWedgePlugin |
| paramList | DataWedgePluginParameters |
| pluginName | DataWedgePlugin |
| resetConfig | boolean |
DataWedgePluginParameters
SetDisabledAppListOptions
| Prop | Type |
| ---------------- | ------------------------------------------------------------------- |
| appList | DataWedgeAppConfig[] |
| configMode | DataWedgeConfigMode |
IgnoreDisabledProfilesResult
| Prop | Type |
| ------------- | -------------------- |
| enabled | boolean |
RegisterForNotificationOptions
| Prop | Type |
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
| appName | string |
| callback | ((notification: ZebraNotificationEvent) => void) |
| intentAction | string |
| notificationType | DataWedgeNotificationType |
ZebraNotificationEvent
| Prop | Type |
| ---------------------- | ---------------------------------------------------------------- |
| notificationType | string |
| profileName | string |
| scannerStatus | string |
| status | string |
| raw | Record<string, unknown> |
RegisterScanIntentActionOptions
| Prop | Type | Description |
| ------------------ | ------------------- | ----------------------------------------------------------------------------------------- |
| intentAction | string | DataWedge intent action used for barcode scan broadcasts (physical trigger or soft scan). |
ZebraDeviceScanner
| Prop | Type |
| --------------------- | -------------------- |
| connectionState | boolean |
| id | string |
| index | number |
| name | string |
ZebraProfileConfiguration
| Prop | Type |
| ---------------------- | ------------------------------------ |
| appList | DataWedgeAppConfig[] |
| pluginConfigList | DataWedgePluginConfig[] |
| profileEnabled | boolean |
| profileName | string |
GetConfigOptions
| Prop | Type |
| ------------------- | ---------------------------------- |
| pluginConfigs | PluginConfigOptions[] |
| profileName | string |
PluginConfigOptions
| Prop | Type |
| ---------------------- | ----------------------------------------------------------- |
| outputPluginName | DataWedgePlugin |
| pluginName | DataWedgePlugin |
DataWedgeStatusResult
| Prop | Type |
| --------------- | -------------------- |
| isEnabled | boolean |
ZebraDeviceVersionInfo
| Prop | Type |
| ----------------------------- | --------------------- |
| barcodeVersion | string |
| dataWedgeVersion | string |
| decoderVersion | string |
| scannerFirmwareVersions | string[] |
| simulScanVersion | string |
DataWedgeNotifyOptions
| Prop | Type |
| -------------------------- | --------------------- |
| deviceIdentifier | string |
| notificationSettings | number[] |
ReportingOptions
| Prop | Type |
| ---------------------------------- | ----------------------------------------- |
| reportingEnabled | boolean |
| reportingGenerateOption | 'manual' | 'auto' | 'both' |
| reportingShowForManualImport | boolean |
ZebraScanResult
| Prop | Type |
| ------------------ | ------------------- |
| data | string |
| decodedMode | string |
| intentAction | string |
| labelType | string |
| source | string |
SwitchScannerParamsOptions
| Prop | Type |
| ----------------------- | ------------------------------------------------------------------------------- |
| scannerIdentifier | ScannerIdentifier |
| scannerParams | DataWedgePluginParameters |
PluginVersionResult
| Prop | Type |
| ------------- | ------------------- |
| version | string |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
Type Aliases
Omit
Construct a type with the properties of T except for those in type K.
Pick
From T, pick a set of properties whose keys are in the union K
{ [P in K]: T[P]; }
Exclude
Exclude from T those types that are assignable to U
T extends U ? never : T
Record
Construct a type with a set of properties K of type T
{ [P in K]: T; }
Enums
DataWedgeConfigMode
| Members | Value |
| ------------------------- | ---------------------------------- |
| CREATE_IF_NOT_EXIST | 'CREATE_IF_NOT_EXIST' |
| OVERWRITE | 'OVERWRITE' |
| REMOVE | 'REMOVE' |
| UPDATE | 'UPDATE' |
DataWedgePlugin
| 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' |
ScannerStatus
| Members | Value |
| ------------------ | --------------------------- |
| CONNECTED | 'CONNECTED' |
| DISABLED | 'DISABLED' |
| DISCONNECTED | 'DISCONNECTED' |
| IDLE | 'IDLE' |
| SCANNING | 'SCANNING' |
| WAITING | 'WAITING' |
DataWedgeNotificationType
| Members | Value |
| -------------------------- | ----------------------------------- |
| CONFIGURATION_UPDATE | 'CONFIGURATION_UPDATE' |
| PROFILE_SWITCH | 'PROFILE_SWITCH' |
| SCANNER_STATUS | 'SCANNER_STATUS' |
ScannerIdentifier
| 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' |
