Files
Terry SuttonandIvan Vasilov bc0977f492 UI library/docs (#34377)
* Add faq sections

* Update the faq.

* Minor updates to the client and auth guides.

* Add missing pages to the sidebar.

* Rename the React category to React SPA.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-25 15:00:13 +01:00

33 lines
1.3 KiB
Plaintext

---
title: Next.js
description: Supabase client for Next.js
---
## Installation
<BlockItem name="supabase-client-nextjs" description="Supabase Client for Next.js" />
## Folder structure
<RegistryBlock itemName="supabase-client-nextjs" />
## Usage
This block installs a Supabase client to be used by Next.js. It's meant to be used with app router and it's fully SSR compatible.
If you already have your Supabase client(s) set up and working well (through the through `npx create-next-app -e with-supabase` template or in another way) you can just continue using them.
To get started, you need to add an `.env` file to your project with the following entries:
```env
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
```
If you're using a local instance of supabase, you can find these values by running `supabase start` or `supabase status` (if already running).
If you're using supabase.com project, you can find them in the [Connect modal](https://supabase.com/dashboard/project/_?showConnect=true) under App Frameworks or in your project's [API settings](https://supabase.com/dashboard/project/_/settings/api).
This block provides Supabase clients designed for use with SSR by storing JWT tokens in cookies. If you're
developing a React SPA, use the [React SPA client](/ui/docs/react-router/client) instead.