@capgo/capacitor-zebra-datawedge
v8.0.0
Published
Capacitor plugin for Zebra DataWedge profile management, notifications, queries, and soft scanning on Zebra Android devices.
Maintainers
Readme
@capgo/capacitor-zebra-datawedge
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
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);
});
const result = await ZebraRuntime.softScanTrigger(intentAction);
console.log(result);Notes
- 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.
API
cloneProfile(...)createProfile(...)deleteProfile(...)importConfig(...)renameProfile(...)restoreConfig()setConfig(...)setDisabledAppList(...)setIgnoreDisabledProfiles(...)registerForNotification(...)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'> |
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 |
| -------------------- | ------------------------------------------------------------------- |
| appList | DataWedgeAppConfig[] |
| configMode | DataWedgeConfigMode |
| pluginConfigs | DataWedgePluginConfig[] |
| profileEnabled | boolean |
| profileName | string |
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> |
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<T, Exclude<keyof T, 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' |
