0

I am a newbie dev trying to build a web application that can read and write to an RFID Card through the browser.

I am currently using an ACR122U Card Reader and have gotten it reading directly to my server in NodeJS with the nfc-pcsc node package.

Of course, I don't want to have my users have to run their own server and install a ton of libraries to read a card. Ideally, they can just plug a card reader into their USB port and communicate from USB>Browser>Node Server and back again.

Can anyone recommend a good way to communicate with a USB RFID reader through the browser (and send to backend server?). Thanks

Andy
  • 23
  • 2
  • 4

1 Answers1

0

As far as I know, at the moment (Mar.2021) there is only experimental support for USB in browsers (WebUSB API). Please refer to https://developer.mozilla.org/en-US/docs/Web/API/USB

As this API is experimental, you may not want to rely on it for production. In this case, a component running on end users machine will be needed (e.g. a more or less simple service that responds via https at 'localhost'. This approach opens several usability/security concerns (such as supplying a trusted certificate for localhost, properly managing CORS headers etc).

You may want to refer to this question for additional suggestion: Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?

Alexey Adadurov
  • 174
  • 1
  • 5