© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
Audrow

Getting user data on dynamic page with Next JS

I'm trying to make a dynamic page with NextJS using data stored in Supabase. This requires me to use
getStaticPaths
getStaticPaths
to specify which pages are valid and
getStaticProps
getStaticProps
to load one row's data for the page. I'm having trouble getting my user data in the
getStaticPaths
getStaticPaths
method, so that I can get items that are specific to that user. I'm also using row level security in my tables, so that a user can only select their data.

Any advice on how to proceed here? I'm planning to look more into
@supabase/supabase-auth-helpers/nextjs
@supabase/supabase-auth-helpers/nextjs
and maybe make an API route that I can use to get my current user's ID, and then I can use that with a service-level Supabase client.
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

Query data with Next.js
SupabaseSSupabase / help-and-questions
4y ago
Having trouble getting user in Next JS 14 route handler
SupabaseSSupabase / help-and-questions
3y ago
Next.js force-dynamic for auth cookies?
SupabaseSSupabase / help-and-questions
2mo ago
Next.js | Problem with session data inside getServerSideProps
SupabaseSSupabase / help-and-questions
4y ago