5

In npm we have a facility called as "get-mac-address" which returns the MAC address as an object. I want it to be embedded in my react web app. I feel difficulty bcoz react ES6 doesn't support var getMacAddress = require("get-mac-address") code. This link has output in normal js:-get-mac-address.

Could anyone provide the equal react version of it please.

Abhinav Kinagi
  • 3,653
  • 2
  • 27
  • 43
  • Probable duplicates: https://stackoverflow.com/questions/3385/mac-addresses-in-javascript and https://security.stackexchange.com/questions/150040/how-to-get-client-mac-address-using-angular-js Problem is not React or Angular or even though Javascript. – devserkan Apr 01 '18 at 20:50
  • 1
    Are you trying to get the MAC address of the user loading your React site, or the MAC address of your own server that is serving React? It seems like you might be better off asking what it is you're actually trying to achieve by using the MAC address. – loganfsmyth Apr 02 '18 at 02:18
  • Yeah! I am trying to get the MAC address of the user loading my React site – Abhinav Kinagi Apr 02 '18 at 07:25
  • 1
    According to all the answers I’ve seen poking around the web, the answer is no, because JavaScript can’t get low enough to obtain it. But I would absolutely love it if someone came up with a way for JS to extract it – alilland Apr 28 '18 at 01:08
  • @alilland or Abhinav did you found any solution? – Rahul Sharma May 01 '19 at 03:15
  • No, I think it's too heavy for JS to acquire MAC of device it's loaded on. Still waiting for devs for any such package. But there are ways to acquire MAC by setting up RADIUS server as it works on application layer. – Abhinav Kinagi May 01 '19 at 06:03

0 Answers0