Curated list of resources relating to the WebHID (Human Interface Device) API
WebHID is a browser API (
navigator.hid) that provides access to HID input/output devices. It's a higher level of abstraction than the WebUSB and Web Bluetooth APIs, but lower than the Gamepad API and basic input (pointer/keyboard).
Contributions welcome. Add links through pull requests or create an issue to start a discussion. See contribution guidelines.
- Good to know
- Specification & documentation
- Blogs & articles
- Talks & videos
- Bluetooth, USB, & HID reference
- Demos, experiments & hacks
- Real-world applications
- Inspiration from elsewhere
- Forums & discussion
Always up to date information - Chrome Platform Status: WebHID
As of 19 September 2019:
- Available behind a flag in version 78.
- Version 78 is currently in beta
- Origin trials expected in version 80 (estimated stable early 2020).
- Release expected in version 83.
Good to know
- WebHID is not a W3C Standard nor is it on the W3C Standards Track(ref).
- Devices that generate trusted input (e.g. keyboards, mice, security keys) will not be accessible. Such devices define their reports in top-level HID collections that will be considered protected usages(ref1), (ref2).
- Access to a device must be granted by the user via a chooser dialog provided by the browser, similarly to WebUSB and Web Bluetooth. Launching the chooser must be done from the context of a user gesture (e.g. a mouse click).
- Neither the WebUSB(ref) or Web Bluetooth(ref) APIs allow access to HID-class devices.
Specification & documentation
- WebHID API Specification (Web Platform Incubator Community Group (WICG)) - Including introduction, motivating applications, and security/privacy.
- WebHID Explainer - The what & why in a nutshell, including basic terminology and an example. Some API details outdated.
- WebHID (Human Interface Device) - Chrome Platform Status
- Chromium implementation tracking bug: WebHID API - Labelled with targeted & stable release versions; see the development/release calendar.
Blogs & articles
- Upcoming WebHID API - access Bluetooth/USB HID devices in web applications - An introduction to WebHID with an example showing how to open, listen for input and send output to a device.
Talks & videos
Devices that work well with WebHID, and device-specific abstraction libraries. Do also file an issue to inform others of devices that don't. Not all devices in the USB HID device class will communicate using the high-level abstractions.
- Blink(1) - notification light (see demos section, and node-blink1).
- BlinkStick - light devices and controllers (see demos section, and blinkstick-node)
- Cleware - sensors, switches, and lights (see clewarecontrol, sniner/cleware)
- Espruino Pico board - has an USB HID mode, might also be useful as an emulator?
- Jabra headsets (see Standard USB HID Specification)
- Nintendo Switch Pro Controller(ref)
- Sony DualShock 3 & 4(ref)
- X-keys - keyboards, switches, analog controls, and pedals (see HID Data Reports, Integration, xkeys, node-xkeys)
- Xbox Wireless Controller(ref)
Software that aids working with devices.
- USBDeview - View device information.
- USB Device Tree Viewer - View device information including interface and HID descriptors.
- node-hid - Cross-platform library for accessing USB HID devices from Node.js or Electron.
Bluetooth, USB, & HID reference
Information about the underlying technologies, including specifications and explanations.
- Human Interface Devices (HID) Information (USB Implementers Forum (USB-IF)) - Including the device class definition, and usage tables.
- Human Interface Device Profile specification (Bluetooth Special Interest Group (SIG)) - "An adaptation of the USB HID Specification to operate over a Bluetooth wireless link."
- A Closer Look at HID Class - Explanation of USB HID, with enough detail yet easy to follow.
- Understanding HID report descriptors - Understanding devices' descriptions of themselves.
Demos, experiments & hacks
- todbot/blink1-webhid - using the blink(1) USB light.
- robatwilliams/webhid-demos - using the BlinkStick Strip.
- Ergometer Space - Track your indoor rowing exercise, alone or with other online users.
Inspiration from elsewhere
Transferrable inspiration from related areas such as general Bluetooth/USB HID, Web Bluetooth, and WebUSB.
- chrome.hid API sample - Generic input/output Chrome App sample.
- blink(1) using the chrome.hid API - Chrome App sample that controls a Blink(1) notification LED.
- Interacting with USB HID devices from web apps - Using a Chrome App as a go-between between a dictation foot pedal and a web application (2015).
- Web Bluetooth Demos (Web Bluetooth Community Group) - Various, plus links to others.
- Griffin Powermate Playground - Using WebUSB.
- node-hid examples - Despite the name, most directly use low-level read/write operations rather than HID abstractions.
Great idea, no time or no device? File an issue to share.
- Device explorer tool - Web tool for conveniently viewing device info, monitoring input reports, and sending output/feature reports; something in the style of this one for Web Bluetooth.
Forums & discussion
- Human Interface Device (HID) API (WICG Discourse) - Introduction by the editor of the specification, and answers to questions.
- Intent to Implement: WebHID (Human Interface Device) (chromium.org blink-dev) - Introduction by the editor of the specification, and answers to questions.
- Web Bluetooth API (MDN)
- WebUSB API (MDN)
- chrome.hid API - For Chrome Apps.
- Web Serial API
- Specification (WICG)
- Discussion (WICG Discourse)
- Chromium implementation tracking bug: Web Serial API