Next.js Discord

Discord Forum

get user agent in server component

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Avatar
Giant pandaOP
how can i get user agent in server component?
in app router

8 Replies

Avatar
B33fb0n3
You can get them thought the headers
Avatar
Giant pandaOP
i tried but i have in my headers only cookies not user agent is always null
Avatar
B33fb0n3
Are you able to log all headers?
Avatar
Giant pandaOP
yeah all empty
Avatar
Giant pandaOP
bound Headers {
Symbol(headers list): HeadersList {
cookies: null,
Symbol(headers map): Map {},
Symbol(headers map sorted): null
},
Symbol(guard): 'none'
}
Avatar
B33fb0n3
Hm weird. Then I don’t have a solution. Sorry
Avatar
Giant pandaOP
ok thank you
any one else??