© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
5 replies
Wessire

React/Next.js

It seems to be that you end up with a lot of calls to "createClientX" in my case "const supabase = createServerComponentClient({ cookies: () => cookies() })" in every component where you need to make a request to your supabase instance.

Obviously this could be put in a different file and function, but then I'd be concerned with how cookies() works, and ensuring that we are always using the correct JWT for authentication for the particular request.

Is there an idiomatic way to abstract away the call to createServerComponentClient in a safe way?
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

What Supabase initialization to use for Next.js with React
SupabaseSSupabase / help-and-questions
6mo ago
Next.js SSR RLS
SupabaseSSupabase / help-and-questions
13mo ago
Next JS Service Client
SupabaseSSupabase / help-and-questions
13mo ago
Next.js - useSession flickering
SupabaseSSupabase / help-and-questions
4y ago