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?
Was this page helpful?