Files
supabase/apps/ui-library/content/docs/react/client.mdx
Ivan Vasilov 0bd892547c fix: Use the new envVars property in the shadcn blocks (#37585)
* Search and replace all mentions of SUPABASE_ANON_KEY.

* Copy over some comments from the nextjs template.

* Bump shadcn version.

* Change the building of the blocks to append envVars and docs.

* Use the new envVars property in the clients.

* Rebuild all blocks.

* Fix the wording.

* Update the docs.
2025-08-04 10:30:53 +02:00

36 lines
1.2 KiB
Plaintext

---
title: Supabase Client Libraries
description: Supabase client for React Single Page Applications
---
## Installation
<BlockItem name="supabase-client-react" description="Supabase Client for React SPA" />
## Folder structure
<RegistryBlock itemName="supabase-client-react" />
## Usage
This block installs a Supabase client for connecting your React project to Supabase. It's designed for use in client-side components.
If you've already set up a Supabase client in your project, you can just continue using that existing setup.
### Getting started
After installing the block, you'll have the following environment variables in your `.env.local` file:
```env
VITE_SUPABASE_URL=
VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY=
```
- If you're using supabase.com, you can find these values 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).
- 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).
## Further reading
- [Generating TypeScript types for your client](https://supabase.com/docs/guides/api/rest/generating-types)