mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem After #53183 and #52567 have been addressed, we should strengthen the interconnections between the UI library and the rest of the Supabase ecosystem. ## Solution - Adds contextual links for `/library`, Auth / Realtime category pages, and specific Auth / Realtime components. Hits top-level product pages, docs, kb, and blogs. ## Preview links N/A, link changes are relatively atomic so easier to review without many preview links. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
---
|
|
title: Supabase Client Libraries
|
|
description: Supabase client for Next.js
|
|
preview: <BlockOverview name="supabase-client-nextjs" showFiles />
|
|
---
|
|
|
|
## Installation
|
|
|
|
<BlockItem name="supabase-client-nextjs" />
|
|
|
|
## Usage
|
|
|
|
This block installs a Supabase client for connecting your Next.js project to Supabase. It's designed for use with the App Router and fully supports server-side rendering (SSR).
|
|
|
|
If you've already set up your Supabase client—either using the `npx create-next-app -e with-supabase` template or another method—you can continue using your existing setup.
|
|
|
|
### Getting started
|
|
|
|
After installing the block, you'll have the following environment variables in your `.env.local` file:
|
|
|
|
```env
|
|
NEXT_PUBLIC_SUPABASE_URL=
|
|
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=
|
|
```
|
|
|
|
- If you're using supabase.com, you can find these values in the [Connect modal](https://supabase.com/dashboard/project/_?showConnect=true&connectTab=frameworks&framework=nextjs) under App Frameworks or in your project's [API settings](https://supabase.com/dashboard/project/_/settings/api).
|
|
|
|
- If you're using a local instance of Supabase, you can find these values by running `supabase start` or `supabase status` (if you already have it running).
|
|
|
|
<Callout type="warning" className="mt-4">
|
|
{' '}
|
|
This Supabase client is built for SSR with the Next.js App Router. If you're building a React SPA,
|
|
use the [React SPA client](/library/docs/react-router/client) instead.{' '}
|
|
</Callout>
|
|
|
|
## Further reading
|
|
|
|
- [Generating TypeScript types for your client](https://supabase.com/docs/guides/api/rest/generating-types)
|
|
- [Use Supabase with Next.js](https://supabase.com/docs/guides/getting-started/quickstarts/nextjs)
|
|
- [Creating a Supabase client for SSR](https://supabase.com/docs/guides/auth/server-side/creating-a-client)
|
|
- [API keys](https://supabase.com/docs/guides/getting-started/api-keys)
|
|
- [Securing your API](https://supabase.com/docs/guides/api/securing-your-api)
|