We’re developing a solution to read data from USB devices and expose the data read from USB devices to a third party web app running in a browser.
The solution I’ve planned so far is like this:
We develop an Electron desktop app, which is installed on customer end user workstations and can read the data from USB devices. As far as I checked, there are node libraries for accessing USB devices and they work pretty fine.
The Electron desktop app has a built in web server which is running on some port X.
We provide a standard web based JS library which connects to the web server running inside the electron app on the local machine on port X. I believe there are no limits for JS to do a standard GET request to a http://localhost:X/get-my-data/
The user prepares the USB device (probably ticks some buttons on the Electron desktop app) and gets the data from the USB device seamlessly in their web application.
Does it sound reasonable or is there a better solution in providing a seamless integration of data obtained from USB devices into a web application?
I’ve looked into Chrome native API for accessing USB devices, however, I run into some permission issues on my Mac and it looks like they are removing it in some not so distant future.