--- title: 'Use Supabase with React' subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a React app.' breadcrumb: 'Framework Quickstarts' hideToc: true --- Create a React app using a [Vite](https://vitejs.dev/guide/) template. ```bash Terminal npm create vite@latest my-app -- --template react ``` 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`. ```bash Terminal cd my-app && npm install @supabase/supabase-js ``` In `App.jsx`, create a Supabase client using your project URL and public API (anon) key: Add a `getInstruments` function to fetch the data and display the query result to the page. ```js src/App.jsx import { useEffect, useState } from "react"; import { createClient } from "@supabase/supabase-js"; const supabase = createClient("https://.supabase.co", ""); function App() { const [instruments, setInstruments] = useState([]); useEffect(() => { getInstruments(); }, []); async function getInstruments() { const { data } = await supabase.from("instruments").select(); setInstruments(data); } return (
    {instruments.map((instrument) => (
  • {instrument.name}
  • ))}
); } export default App; ```
Start the app, go to http://localhost:5173 in a browser, and open the browser console and you should see the list of instruments. ```bash Terminal npm run dev ```
## Next steps - Set up [Auth](/docs/guides/auth) for your app - [Insert more data](/docs/guides/database/import-data) into your database - Upload and serve static files using [Storage](/docs/guides/storage)