© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Bennett

Next.js helpers v2 - Get user or session on the server without HOF (`withPageAuth`)

Is there a way to get the user or session on the server (e.g. a Next.js API route) from the cookie like in v1.x?
Before, one could just do
await supabase.auth.api.getUserByCookie(req)
await supabase.auth.api.getUserByCookie(req)
, is there an alternative for v2?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using withPageAuth without a session
SupabaseSSupabase / help-and-questions
4y ago
Get user server-side on supabase js 2.0 + next.js
SupabaseSSupabase / help-and-questions
4y ago
Get user.id server-side in Next.js
SupabaseSSupabase / help-and-questions
4y ago
How to get user or session info on server side?
SupabaseSSupabase / help-and-questions
4y ago