files/en-us/web/api/hiddevice/open/index.md
{{securecontext_header}}{{APIRef("WebHID API")}}{{SeeCompatTable}}{{AvailableInWorkers("window_and_worker_except_shared")}}
The open() method of the {{domxref("HIDDevice")}} interface requests that the operating system opens the HID device.
[!NOTE] HID devices are not opened automatically. Therefore, a {{domxref("HIDDevice")}} returned by {{domxref("HID.requestDevice()")}} must be opened with this method before it is available to transfer data.
open()
None.
A {{jsxref("Promise")}} that resolves with undefined once the connection is opened.
InvalidStateError {{domxref("DOMException")}}
NotAllowedError {{domxref("DOMException")}}
In the following example, we wait for the HID connection to open before attempting to send or receive data.
await device.open();
{{Specifications}}
{{Compat}}