FeatureFuel
9

createServerClient singleton pattern Nextjs App Router

Source: supabase/supabase#26936 · opened by @andrewdoro
I am looking for a way to create a singleton pattern for createServerClient.



Describe the problem

[Add a link to the page which needs improvement (if relevant)](
using the pattern from docs with createClient will create a connection for each invocation. This is problematic when calling this in multiple Server Components. I am not sure what's the cost of doing this.

Describe the improvement

the following example fails on build on nextjs

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests