Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Merge pull request #14860 from supabase/docs/add-nextjs-auth-helpers-videos

Jon Meyers96340f6aa707
diff --cc apps/docs/pages/guides/auth/auth-helpers/nextjs.mdx
index d783f804feb,fae648f73c4..f8ded004290
--- a/apps/docs/pages/guides/auth/auth-helpers/nextjs.mdx
+++ b/apps/docs/pages/guides/auth/auth-helpers/nextjs.mdx
@@@ -521,16 -548,17 +548,25 @@@ export default function Home()
> check out [this repo](https://github.com/supabase/supabase/tree/master/examples/auth/nextjs) for more examples, including [realtime subscriptions](https://github.com/supabase/supabase/tree/master/examples/auth/nextjs/app/realtime-posts.tsx).
+#### Singleton
+
+The `createClientComponentClient` function implements a [Singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) to simplify instantiating Supabase clients. If you need multiple Supabase instances across Client Components - for example, when using multiple schemas - you can pass an additional configuration option for `{ isSingleton: false }` to get a new client every time this function is called.
+
+```jsx
+const supabase = createClientComponentClient({ isSingleton: false })
+```
+
### Server Component
+ <div className="video-container">
+ <iframe
+ src="https://www.youtube-nocookie.com/embed/SUS1t6Kq7-8"
+ frameBorder="1"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowFullScreen
+ ></iframe>
+ </div>
+
[Server Components](https://nextjs.org/docs/getting-started/react-essentials#server-components) allow for asynchronous data to be fetched server-side.
> Note: In order to use Supabase in Server Components, you need to have implemented the [Middleware](/docs/guides/auth/auth-helpers/nextjs#refresh-session-with-middleware) steps above.