S
docs- Words
- 558
- Reading time
- 3 min
- Published
- 2026-08-27
- Last crawled
- 2026-08-27
- Cited by
- 1 of their pages
- Language
- EN
cat supabase.com/docs/guides/getting-started/quickstarts/reactjs.md
Learn how to create a Supabase project, add some sample data to your database, and query the data from a React app. To start, you need a Supabase project. Create a new Supabase project from [the Dashboard of any organization](https://supabase.com/dashboard/new/_) you belong to. When your Supabase project is up and running, create an `instruments` table with some sample data. Then set only the privileges each Postgres role needs, add [Row Level Security (RLS)](https://supabase.com/docs/guides/database/postgres/row-level-security) for enhanced security for database data by default, and create an RLS policy to make the data in the table publicly readable. Do these steps within your project's dashboard by copying and running the snippet in your project's [SQL Editor](https://supabase.com/dashboard/project/_/sql/new). Create a React app using a [Vite](https://vitejs.dev/guide/) template. Supabase provides two ways to give AI tools context about your project: Agent Skills, which give your AI coding agent procedural knowledge, and the MCP server, which connects AI assistants to your Supabase project directly. ### Agent Skills[#](#agent-skills) [Agent Skills](https://supabase.com/docs/guides/ai-tools/ai-skills) is a curated set of instructions that give your AI agent procedural knowledge about working with Supabase. Install them so your AI coding agent can produce more accurate, reliable code using current Supabase patterns, such as authentication, server-side rendering, and database migrations, rather than relying solely on training data. #### Installing Agent Skills[#](#installing-agent-skills) To install, run the following command in the root of your project: ### Supabase MCP server[#](#supabase-mcp-server) The Supabase MCP server connects AI assistants to Supabase, so they can inspect your schema and act on your projects on your behalf. Find out how to add it to your client in [the MCP docs](https://supabase.com/docs/guides/ai-tools/mcp). The fastest way to get started is to use the `supabase-js` client library, which provides a convenient interface for working with Supabase from a React app. Navigate to the React app and install `supabase-js`. Create a `.env.local` file and populate it with your Supabase URL and publishable key that you can get from the helper below, or [from the project **Connect** panel](https://supabase.com/dashboard/project/_?showConnect=true&framework=react&connectTab=frameworks) [ Open Connect panel ](https://supabase.com/dashboard/project/_?showConnect=true&connectTab=frameworks&framework=react) .env.local ### Get API details[#](#get-api-details) To interact with data in database tables, you use the client libraries that wrap [the auto-generated Data API endpoints](https://supabase.com/docs/guides/api), authenticating using the Project URL and key from [the project **Connect** dialog](https://supabase.com/dashboard/project/_?showConnect=true&connectTab=frameworks&framework=react). Project URL Publishable key Create a `src/lib` directory in your React app, create a file called `supabaseClient.js`, and add the following code to initialize the Supabase client: src/lib/supabaseClient.js Replace the contents of `App.jsx` with a `getInstruments` function that fetches the data and displays the query result on the page. src/App.jsx Run the development server, go to [http://localhost:5173](http://localhost:5173/) in a browser, and you should see the list of instruments. The quickstart procedure in this guide optimizes for getting you to a working app, not for production. Before you deploy: - If your app reads or writes through the Data API, review your [Row Level Security](https://supabase.com/docs/guides/database/postgres/row-level-security) policies. Any policy you added here is scoped to this quickstart's sample data, not to real user data.- Set your Supabase credentials as environment variables on whatever platform you deploy to, rather than committing them to source control.- Configure a [custom domain](https://supabase.com/docs/guides/platform/custom-domains) for your Supabase project once you're ready to go live. - Set up [Auth](https://supabase.com/docs/guides/auth) for your app- [Insert more data](https://supabase.com/docs/guides/database/import-data) into your database- Upload and serve static files using [Storage](https://supabase.com/docs/guides/storage)- Explore [drop-in UI components](https://supabase.com/ui) for your Supabase app
