© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
21 replies
매튜

Get user.id server-side in Next.js

I'm trying to select user-specific rows using the UUID in getServerSideProps in Next.js but haven't found a solution yet (using auth-helpers). The below works client side but not server side.

export const getServerSideProps = withPageAuth({
redirectTo: '/',
async getServerSideProps() {
// Find out how many words user is currently studying at novice level - maximum allowed is 200
const { data } = await supabaseServerClient()
.from('_users_vocabulary')
.select('*')
.eq('B', user.id);
return { props: { data } };
}
});
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

Get user server-side on supabase js 2.0 + next.js
SupabaseSSupabase / help-and-questions
4y ago
How to get current user data server side (next.js middleware)
SupabaseSSupabase / help-and-questions
4y ago
Next.js, user doesn't get authenticated
SupabaseSSupabase / help-and-questions
4y ago
Get authenticated user_id from twitter id
SupabaseSSupabase / help-and-questions
4y ago