0

How can I use userAgentData on server(Nodejs)? In express i am trying to use new JS api: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData

I tried this `

console.log(global.navigator)

But this is printing undefined.

I am also on https.

Yhshsh
  • 3
  • 1

1 Answers1

1

You will be able to access that field as follows on client side:

window.navigator.userAgentData

Note: You cannot access userAgentData from the server. You would have to access the data in the frontend and pass it to your server through the request body.

M. G.
  • 343
  • 1
  • 7