Requirements

  • A browser implementing Web Serial.
  • HTTPS in production or localhost during development.
  • A user action, such as a button click, before opening the device chooser.
  • Exclusive access to the selected serial port.
Keep a reference to the device instance so you can dispose it later. Automatic refresh is disabled by default; set device.autoRefresh = true if your application needs periodic state updates.