
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@kduma-autoid/capacitor-sunmi-scanhead
Advanced tools
Sunmi Scan Head bindings for Capacitor
npm install @kduma-autoid/capacitor-sunmi-scanhead
npx cap sync
You can disable auto binding of the service by setting bindOnLoad to false in the plugin configuration in capacitor.config.ts.
/// <reference types="@kduma-autoid/capacitor-sunmi-scanhead" />
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: "com.company.app",
...
plugins: {
SunmiScanHead: {
bindOnLoad: true
}
}
}
export default config;
bindService()unBindService()scan()stop()getScannerModel()clearConfig()setTrigger(...)setOutputMode(...)setScanMode(...)setReturnCodeType(...)setBroadcast(...)setBroadcastConfiguration(...)addListener('onScanResult', ...)addListener('onScanStart', ...)addListener('onScanStop', ...)removeAllListeners()bindService() => Promise<void>
bind scan service
unBindService() => Promise<void>
unbind scan service
scan() => Promise<void>
Start scanner
stop() => Promise<void>
Stop scanner
getScannerModel() => Promise<{ model: number; }>
Get scanner model ID
Returns: Promise<{ model: number; }>
clearConfig() => Promise<void>
Clear scanner configuration (reset to default)
setTrigger(options: { enabled: boolean; }) => Promise<void>
Enable or disable trigger button
| Param | Type |
|---|---|
options | { enabled: boolean; } |
setOutputMode(options: { mode: OutputMode.DISABLED; } | { mode: OutputMode.KEYSTROKE; interval?: number; tab?: boolean; enter?: boolean; } | { mode: OutputMode.DIRECTFILL; overwrite?: boolean; tab?: boolean; enter?: boolean; asEvent?: boolean; }) => Promise<void>
Set output mode
| Param | Type |
|---|---|
options | { mode: OutputMode.DISABLED; } | { mode: OutputMode.KEYSTROKE; interval?: number; tab?: boolean; enter?: boolean; } | { mode: OutputMode.DIRECTFILL; overwrite?: boolean; tab?: boolean; enter?: boolean; asEvent?: boolean; } |
setScanMode(options: { mode: ScanMode.TRIGGER | ScanMode.PULSE; timeout?: number; } | { mode: ScanMode.CONTINUOUS | ScanMode.LONGPRESS; sleep?: number; timeout?: number; }) => Promise<void>
Set scan mode
| Param | Type |
|---|---|
options | { mode: ScanMode.TRIGGER | ScanMode.PULSE; timeout?: number; } | { mode: ScanMode.CONTINUOUS | ScanMode.LONGPRESS; sleep?: number; timeout?: number; } |
setReturnCodeType(options: { enabled: boolean; }) => Promise<void>
Enable or disable returning of code type with scan result
| Param | Type |
|---|---|
options | { enabled: boolean; } |
setBroadcast(options: { enabled: boolean; }) => Promise<void>
Enable or disable scan result broadcast
| Param | Type |
|---|---|
options | { enabled: boolean; } |
setBroadcastConfiguration(options?: { scanned_intent?: string | null | undefined; start_intent?: string | null | undefined; end_intent?: string | null | undefined; intent_data_key?: string | null | undefined; intent_byte_key?: string | null | undefined; } | undefined) => Promise<void>
Set broadcast configuration
| Param | Type |
|---|---|
options | { scanned_intent?: string | null; start_intent?: string | null; end_intent?: string | null; intent_data_key?: string | null; intent_byte_key?: string | null; } |
addListener(eventName: 'onScanResult', listenerFunc: (scan: { data: string; source_bytes: string; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Listens for barcode scanner result events.
| Param | Type |
|---|---|
eventName | 'onScanResult' |
listenerFunc | (scan: { data: string; source_bytes: string; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'onScanStart', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Listens for barcode scanner start events.
| Param | Type |
|---|---|
eventName | 'onScanStart' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'onScanStop', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Listens for barcode scanner stop events.
| Param | Type |
|---|---|
eventName | 'onScanStop' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners() => Promise<void>
Removes all listeners
| Prop | Type |
|---|---|
remove | () => Promise<void> |
| Members | Value |
|---|---|
KEYSTROKE | "keystroke" |
DIRECTFILL | "directFill" |
DISABLED | "disabled" |
| Members | Value |
|---|---|
TRIGGER | "trigger" |
CONTINUOUS | "continuous" |
PULSE | "pulse" |
LONGPRESS | "longPress" |
FAQs
Sunmi Scan Head bindings for Capacitor
We found that @kduma-autoid/capacitor-sunmi-scanhead demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.