Ben
Ben

Reputation: 4969

Log user browser details in Node.js

Is there a way to log which browser/OS/etc. the user is using from my Node.js app?

Thanks

Upvotes: 1

Views: 288

Answers (1)

Marcus Granström
Marcus Granström

Reputation: 17964

I believe you want the information stored in the Request Header "User-Agent"

var useragent = request.headers['User-Agent']

My user-agent is: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" for chrome

Upvotes: 1

Related Questions