--- title: 'Use Supabase with SolidJS' subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a SolidJS app.' breadcrumb: 'Framework Quickstarts' hideToc: true --- <$Partial path="quickstart_db_setup.mdx" /> Create a SolidJS app using the `degit` command. ```bash name=Terminal npx degit solidjs/templates/js my-app ``` 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 SolidJS app. Navigate to the SolidJS app and install `supabase-js`. ```bash name=Terminal cd my-app && npm install @supabase/supabase-js ``` Create a `.env.local` file and populate with your Supabase connection variables: <$CodeTabs> ```text name=.env.local VITE_SUPABASE_URL= VITE_SUPABASE_PUBLISHABLE_KEY= ``` <$Partial path="api_settings_steps.mdx" variables={{ "framework": "solidjs", "tab": "frameworks" }} /> In `App.jsx`, create a Supabase client to fetch the instruments data. Add a `getInstruments` function to fetch the data and display the query result to the page. ```jsx name=src/App.jsx import { createClient } from "@supabase/supabase-js"; import { createResource, For } from "solid-js"; const supabase = createClient('https://.supabase.co', ''); async function getInstruments() { const { data } = await supabase.from("instruments").select(); return data; } function App() { const [instruments] = createResource(getInstruments); return (
    {(instrument) =>
  • {instrument.name}
  • }
); } export default App; ```
Start the app and go to http://localhost:3000 in a browser and you should see the list of instruments. ```bash name=Terminal npm run dev ```