Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: Remove two pane layout from quickstarts and rearrange the content (#47398)

Chris Chinchilla192a736d7fd6
diff --git a/apps/docs/content/_partials/api_settings.mdx b/apps/docs/content/_partials/api_settings.mdx
index b60a575b2e5..15da66146f3 100644
--- a/apps/docs/content/_partials/api_settings.mdx
+++ b/apps/docs/content/_partials/api_settings.mdx
@@ -1,10 +1,12 @@
### Get API details
-Now that you've created some database tables, you are ready to insert data using the auto-generated API.
+To interact with data in database tables, you use the client libraries that wrap [the auto-generated Data API endpoints](/docs/guides/api), authenticating using the Project URL and key from [the project **Connect** dialog](/dashboard/project/\_?showConnect=true&connectTab={{ .tab }}&framework={{ .framework }}).
-To do this, you need to get the Project URL and key from [the project **Connect** dialog](/dashboard/project/\_?showConnect=true&connectTab={{ .tab }}&framework={{ .framework }}).
+<ProjectConfigVariables variable="url" />
+<ProjectConfigVariables variable="publishable" />
-[Read the API keys docs](/docs/guides/getting-started/api-keys) for a full explanation of all key types and their uses.
+<Admonition type="tip">
-<$Partial path="api_keys_deprecation.mdx" variables={{ "framework": "{{ .framework }}", "tab": "{{ .tab }}" }}
-/>
+[Read the API keys docs](/docs/guides/getting-started/api-keys) for a full explanation of all key types, their uses, and where to find them.
+
+</Admonition>
diff --git a/apps/docs/content/_partials/api_settings_steps.mdx b/apps/docs/content/_partials/api_settings_steps.mdx
deleted file mode 100644
index 19b199f746b..00000000000
--- a/apps/docs/content/_partials/api_settings_steps.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
-{/* TODO: How to completely consolidate partials? */}
-
-### Get API details
-
-Now that you've created some database tables, you are ready to insert data using the auto-generated API.
-
-To do this, you need to get the Project URL and key from [the project **Connect** dialog](/dashboard/project/\_?showConnect=true&connectTab={{ .tab }}&framework={{ .framework }}).
-
-[Read the API keys docs](/docs/guides/getting-started/api-keys) for a full explanation of all key types and their uses.
-
-<$Partial path="api_keys_deprecation.mdx" variables={{ "framework": "{{ .framework }}", "tab": "{{ .tab }}" }}
-/>
diff --git a/apps/docs/content/_partials/quickstart_db_setup.mdx b/apps/docs/content/_partials/quickstart_db_setup.mdx
index eedf4167677..741f1c0c611 100644
--- a/apps/docs/content/_partials/quickstart_db_setup.mdx
+++ b/apps/docs/content/_partials/quickstart_db_setup.mdx
@@ -1,15 +1,53 @@
-<StepHikeCompact.Details title="Create a Supabase project">
+export const sqlSetup = ` -- Create the table
+ create table instruments (
+ id bigint primary key generated always as identity,
+ name text not null
+ );
+
+ -- Insert sample data into the table
+ insert into instruments (name)
+ values
+ ('violin'),
+ ('viola'),
+ ('cello');
+
+ -- Grant the privileges the role needs, which is read access
+ grant select on public.instruments to anon;
+
+ -- Enable row level security for the table
+ alter table instruments enable row level security;
+
+ -- Create a policy to allow the anon role to read from the instruments table
+ create policy "public can read instruments"
+ on public.instruments
+ for select to anon
+ using (true);`
-Go to [database.new](https://database.new) and create a new Supabase project.
+## 1. Create a Supabase project
-Alternatively, you can create a project using the Management API:
+Before you can use Supabase, you need a Supabase project. You can create a project visually in the Dashboard or programmatically using [the Management API](/docs/reference/api/introduction).
-</StepHikeCompact.Details>
+<Tabs scrollable size="small" type="underlined" defaultActiveId="dashboard" queryGroup="create-project">
-<StepHikeCompact.Code>
+<TabPanel id="dashboard" label="Dashboard">
+
+Create a new Supabase project from [the Dashboard of any organization](/dashboard/new/_) you belong to.
+
+<Admonition type="tip">
+
+You can also use [database.new](https://database.new) to create a new Supabase project.
+
+</Admonition>
+
+</TabPanel>
+
+<TabPanel id="management-api" label="Management API">
+
+First, get your access token from the [**Account Settings > Access Tokens**](/dashboard/account/tokens) section of the Dashboard.
+
+Then create a project using [the Management API](/docs/reference/api/introduction):
```bash
-# First, get your access token from https://supabase.com/dashboard/account/tokens
export SUPABASE_ACCESS_TOKEN="your-access-token"
# List your organizations to get the organization ID
@@ -28,19 +66,36 @@ curl -X POST https://api.supabase.com/v1/projects \
}'
```
-</StepHikeCompact.Code>
+</TabPanel>
+
+</Tabs>
-<StepHikeCompact.Details>
+## 2. Set up your database
-When your project is up and running, go to the [**Table Editor**](/dashboard/project/_/editor) section of the Dashboard, create a new table and insert some data. Then in the [**Integrations > Data API**](/dashboard/project/_/integrations/data_api/settings) section of the Dashboard, expose the specific tables or functions you want to access. To automatically grant access for new tables and functions in `public`, enable **Default privileges for new entities**.
+When your Supabase project is up and running, create an `instruments` table with some sample data.
-Alternatively, you can run the following snippet in your project's [SQL Editor](/dashboard/project/_/sql/new).
+Then set a secure baseline by setting only the privileges each Postgres role needs, add [Row Level Security (RLS)](/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 your table publicly readable.
-This creates an `instruments` table with some sample data, sets a secure baseline by setting only the privileges each Postgres role needs, and adds [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security) for enhanced security for database data by default.
+You can click this button to prefill all the SQL needed in [the SQL editor of your project](/dashboard/project/_/sql) in the Dashboard.
-</StepHikeCompact.Details>
+<Button variant="primary" asChild>
+ <a href={`/dashboard/project/_/sql/new?content=${encodeURIComponent(sqlSetup)}`}>Prefill SQL</a>
+</Button>
-<StepHikeCompact.Code>
+<Accordion
+ type="default"
+ openBehaviour="single"
+ chevronAlign="right"
+ justified
+ size="medium"
+ className="text-foreground-light mt-8 mb-6"
+>
+ <AccordionItem
+ header="Want to learn more about the SQL and add it manually?"
+ id="manual-sql"
+ >
+
+ Run the following snippet in your project's [SQL Editor](/dashboard/project/_/sql/new). You can also choose the SQL and prefill it from the **Reference > Samples** menu at the side of the SQL Editor.
```sql SQL_EDITOR
-- Create the table
@@ -61,19 +116,7 @@ This creates an `instruments` table with some sample data, sets a secure baselin
-- Enable row level security for the table
alter table instruments enable row level security;
- ```
-</StepHikeCompact.Code>
-
-<StepHikeCompact.Details>
-
-Create an RLS policy to make the data in your table publicly readable:
-
-</StepHikeCompact.Details>
-
-<StepHikeCompact.Code>
-
- ```sql SQL_EDITOR
-- Create a policy to allow the anon role to read from the instruments table
create policy "public can read instruments"
on public.instruments
@@ -81,4 +124,12 @@ Create an RLS policy to make the data in your table publicly readable:
using (true);
```
-</StepHikeCompact.Code>
+ </AccordionItem>
+
+</Accordion>
+
+<Admonition type="note" label="Disabled the Data API during project setup?">
+
+If you disabled the Data API during project setup, enable it in the [**Integrations > Data API**](/dashboard/project/_/integrations/data_api/settings) section of the Dashboard and expose the specific tables or functions you want to access. To automatically grant access for new tables and functions in `public`, enable **Automatically expose new tables**.
+
+</Admonition>
diff --git a/apps/docs/content/guides/auth/quickstarts/astrojs.mdx b/apps/docs/content/guides/auth/quickstarts/astrojs.mdx
index e0de5fba90f..1baa7521c43 100644
--- a/apps/docs/content/guides/auth/quickstarts/astrojs.mdx
+++ b/apps/docs/content/guides/auth/quickstarts/astrojs.mdx
@@ -106,7 +106,7 @@ hideToc: true
PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_key
```
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "astro", "tab": "frameworks" }} />
+ <$Partial path="api_settings.mdx" variables={{ "framework": "astro", "tab": "frameworks" }} />
</StepHikeCompact.Code>
diff --git a/apps/docs/content/guides/auth/quickstarts/nextjs.mdx b/apps/docs/content/guides/auth/quickstarts/nextjs.mdx
index 78663740a03..30912b80e7e 100644
--- a/apps/docs/content/guides/auth/quickstarts/nextjs.mdx
+++ b/apps/docs/content/guides/auth/quickstarts/nextjs.mdx
@@ -67,7 +67,7 @@ hideToc: true
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_... key
```
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
+ <$Partial path="api_settings.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
</StepHikeCompact.Code>
diff --git a/apps/docs/content/guides/auth/quickstarts/react-native.mdx b/apps/docs/content/guides/auth/quickstarts/react-native.mdx
index 4318c0d3e3b..d8ed113a884 100644
--- a/apps/docs/content/guides/auth/quickstarts/react-native.mdx
+++ b/apps/docs/content/guides/auth/quickstarts/react-native.mdx
@@ -81,7 +81,7 @@ hideToc: true
meta="name=lib/supabase.ts"
/>
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "exporeactnative", "tab": "mobiles" }} />
+ <$Partial path="api_settings.mdx" variables={{ "framework": "exporeactnative", "tab": "mobiles" }} />
</StepHikeCompact.Code>
diff --git a/apps/docs/content/guides/auth/quickstarts/react.mdx b/apps/docs/content/guides/auth/quickstarts/react.mdx
index 7c99938fecd..63cc239e117 100644
--- a/apps/docs/content/guides/auth/quickstarts/react.mdx
+++ b/apps/docs/content/guides/auth/quickstarts/react.mdx
@@ -65,8 +65,7 @@ hideToc: true
Rename `.env.example` to `.env.local` and populate with your Supabase connection variables:
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+ <$Partial path="api_settings.mdx" variables={{ "framework": "react", "tab": "frameworks" }} />
</StepHikeCompact.Details>
@@ -77,7 +76,6 @@ hideToc: true
lines={[[1, -1]]}
meta="name=.env.local"
/>
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "react", "tab": "frameworks" }} />
</StepHikeCompact.Code>
diff --git a/apps/docs/content/guides/auth/server-side/creating-a-client.mdx b/apps/docs/content/guides/auth/server-side/creating-a-client.mdx
index 92ce3e4f2d2..3dfe963a7e5 100644
--- a/apps/docs/content/guides/auth/server-side/creating-a-client.mdx
+++ b/apps/docs/content/guides/auth/server-side/creating-a-client.mdx
@@ -41,10 +41,7 @@ pnpm add @supabase/supabase-js @supabase/ssr
Create a `.env.local` file in the project root directory. In the file, set the project's Supabase URL and Key:
-<ProjectConfigVariables variable="url" />
-<ProjectConfigVariables variable="publishable" />
-
-<$Partial path="api_settings_steps.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
+<$Partial path="api_settings.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
<Tabs scrollable size="small" type="underlined" defaultActiveId="nextjs" queryGroup="framework">
diff --git a/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx b/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx
index 1dd467b0fb3..ac53e7cecfa 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx
@@ -2,188 +2,110 @@
title: 'Use Supabase with Astro'
subtitle: 'Learn how to create a Supabase project, add sample data, and query from an Astro app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: false
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create an Astro app
- <$Partial path="quickstart_db_setup.mdx" />
+Create an Astro app using the `npm create` command.
- </StepHikeCompact.Step>
+```bash
+npm create astro@latest my-app
+cd my-app
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install Supabase client library and Node adapter
- <StepHikeCompact.Details title="Create an Astro app">
+Install the `supabase-js` client library and the `@astrojs/node` adapter to enable server-side rendering.
- - Create an Astro app using the `npm create` command.
+```bash
+npm install @supabase/supabase-js @astrojs/node
+```
- <$Partial path="uiLibCta.mdx" />
+## 5. Configure Astro for SSR
- </StepHikeCompact.Details>
+Update your `astro.config.mjs`.
- <StepHikeCompact.Code>
+```js name=astro.config.mjs
+import node from '@astrojs/node'
+import { defineConfig } from 'astro/config'
- ```bash name=Terminal
- npm create astro@latest my-app
- cd my-app
- ```
+export default defineConfig({
+ output: 'server',
+ adapter: node({
+ mode: 'standalone',
+ }),
+})
+```
- </StepHikeCompact.Code>
+<$Partial path="api_settings.mdx" variables={{ "framework": "astro", "tab": "frameworks" }} />
- </StepHikeCompact.Step>
+## 6. Declare Supabase environment variables
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install Supabase client library and Node adapter">
+Create a `.env.local` file and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=astro&tab=frameworks):
- Install the `supabase-js` client library and the `@astrojs/node` adapter to enable server-side rendering.
+<$CodeTabs>
- </StepHikeCompact.Details>
+```text name=.env.local
+PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Code>
+</$CodeTabs>
- ```bash name=Terminal
- npm install @supabase/supabase-js @astrojs/node
- ```
+## 7. Create a Supabase client helper
- </StepHikeCompact.Code>
+Create a utility file to initialize the Supabase client:
- </StepHikeCompact.Step>
+```ts name=src/lib/supabase.ts
+import { createClient } from '@supabase/supabase-js'
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Configure Astro for SSR">
+const supabaseUrl = import.meta.env.PUBLIC_SUPABASE_URL
+const supabasePublishableKey = import.meta.env.PUBLIC_SUPABASE_PUBLISHABLE_KEY
- Update your `astro.config.mjs`.
+export function createServerClient() {
+ return createClient(supabaseUrl, supabasePublishableKey)
+}
+```
- </StepHikeCompact.Details>
+## 8. Query Supabase data from Astro
- <StepHikeCompact.Code>
+<$Partial path="uiLibCta.mdx" />
- ```js name=astro.config.mjs
- import { defineConfig } from "astro/config";
- import node from "@astrojs/node";
+Create a new file at `src/pages/instruments.astro` and populate with the following.
- export default defineConfig({
- output: "server",
- adapter: node({
- mode: "standalone",
- }),
- });
- ```
+This queries all rows from the `instruments` table you created earlier and renders them on the page.
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
-
- Create a `.env.local` file and populate with your Supabase connection variables:
-
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```text name=.env.local
- PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
-
- </$CodeTabs>
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "astro", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Create a Supabase client helper">
-
- Create a utility file to initialize the Supabase client:
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```ts name=src/lib/supabase.ts
- import { createClient } from "@supabase/supabase-js";
-
- const supabaseUrl = import.meta.env.PUBLIC_SUPABASE_URL
- const supabasePublishableKey = import.meta.env.PUBLIC_SUPABASE_PUBLISHABLE_KEY
-
- export function createServerClient() {
- return createClient(
- supabaseUrl,
- supabasePublishableKey
- );
- }
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Query Supabase data from Astro">
-
- Create a new file at `src/pages/instruments.astro` and populate with the following.
-
- This queries all rows from the `instruments` table in Supabase and renders them on the page.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```astro name=src/pages/instruments.astro
- ---
- import { createServerClient } from "../lib/supabase";
-
- const supabase = createServerClient();
- const { data: instruments } = await supabase.from("instruments").select();
- ---
-
- <html>
- <head>
- <title>Instruments</title>
- </head>
- <body>
- <ul>
- {instruments?.map((instrument) => (
- <li>{instrument.name}</li>
- ))}
- </ul>
- </body>
- </html>
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={8}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server, go to http://localhost:4321/instruments in your browser of choice to check the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
+```astro name=src/pages/instruments.astro
+---
+import { createServerClient } from "../lib/supabase";
- </StepHikeCompact.Code>
+const supabase = createServerClient();
+const { data: instruments } = await supabase.from("instruments").select();
+---
- </StepHikeCompact.Step>
-</StepHikeCompact>
+<html>
+ <head>
+ <title>Instruments</title>
+ </head>
+ <body>
+ <ul>
+ {instruments?.map((instrument) => (
+ <li>{instrument.name}</li>
+ ))}
+ </ul>
+ </body>
+</html>
+```
+
+## 9. Start the app
+
+Run the development server, go to http://localhost:4321/instruments in your browser of choice to check the list of instruments.
+
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/expo-react-native.mdx b/apps/docs/content/guides/getting-started/quickstarts/expo-react-native.mdx
index a4f1b58e0a8..929196f8ea9 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/expo-react-native.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/expo-react-native.mdx
@@ -2,191 +2,124 @@
title: 'Use Supabase with Expo React Native'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from an Expo app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create an Expo app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a minimal Expo app using the `create-expo-app` command with the blank TypeScript template.
- </StepHikeCompact.Step>
+```bash
+npx create-expo-app my-app --template blank-typescript
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create an Expo app">
+The fastest way to get started is to use the `@supabase/supabase-js` client library which provides a convenient interface for working with Supabase from a React Native app.
- Create a minimal Expo app using the `create-expo-app` command with the blank TypeScript template.
+Navigate to the Expo app and install `supabase-js` along with the required dependencies for session storage and URL handling.
- <$Partial path="uiLibCta.mdx" />
+```bash
+cd my-app && npx expo install @supabase/supabase-js react-native-url-polyfill expo-sqlite
+```
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "" }} />
- <StepHikeCompact.Code>
+## 5. Declare Supabase environment variables
- ```bash name=Terminal
- npx create-expo-app my-app --template blank-typescript
- ```
+Create a `.env` file in the root of your project and populate it with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true).
- </StepHikeCompact.Code>
+Expo requires environment variables to be prefixed with `EXPO_PUBLIC_` to be accessible in your app code.
- </StepHikeCompact.Step>
+```text name=.env
+EXPO_PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+## 6. Initialize the Supabase client
- The fastest way to get started is to use the `@supabase/supabase-js` client library which provides a convenient interface for working with Supabase from a React Native app.
+Create a helper file at `lib/supabase.ts` to initialize the Supabase client using the environment variables.
- Navigate to the Expo app and install `supabase-js` along with the required dependencies for secure storage and URL handling.
+The code below uses Expo's localStorage polyfill to persist authentication sessions.
- </StepHikeCompact.Details>
+```ts name=lib/supabase.ts
+import 'react-native-url-polyfill/auto'
- <StepHikeCompact.Code>
+import { createClient } from '@supabase/supabase-js'
- ```bash name=Terminal
- cd my-app && npx expo install @supabase/supabase-js react-native-url-polyfill expo-sqlite
- ```
+import 'expo-sqlite/localStorage/install'
- </StepHikeCompact.Code>
+const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL
+const supabasePublishableKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY
- </StepHikeCompact.Step>
+export const supabase = createClient(supabaseUrl, supabasePublishableKey, {
+ auth: {
+ storage: localStorage,
+ autoRefreshToken: true,
+ persistSession: true,
+ detectSessionInUrl: false,
+ },
+})
+```
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+## 7. Query data from the app
- Create a `.env` file in the root of your project and populate it with your Supabase connection variables.
+Replace the contents of `App.tsx` with the following code to fetch and display the instruments from your database.
- Expo requires environment variables to be prefixed with `EXPO_PUBLIC_` to be accessible in your app code.
+Use `useEffect` to fetch the data when the component mounts and display the query result using React Native components.
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+```tsx name=App.tsx
+import { useEffect, useState } from 'react'
+import { FlatList, StyleSheet, Text, View } from 'react-native'
+import { supabase } from './lib/supabase'
- </StepHikeCompact.Details>
+export default function App() {
+ const [instruments, setInstruments] = useState([])
- <StepHikeCompact.Code>
+ useEffect(() => {
+ getInstruments()
+ }, [])
- ```text name=.env
- EXPO_PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "", "tab": "" }} />
+ async function getInstruments() {
+ const { data } = await supabase.from('instruments').select()
+ setInstruments(data)
+ }
- </StepHikeCompact.Code>
+ return (
+ <View style={styles.container}>
+ <FlatList
+ data={instruments}
+ keyExtractor={(item) => item.id.toString()}
+ renderItem={({ item }) => <Text style={styles.item}>{item.name}</Text>}
+ />
+ </View>
+ )
+}
- </StepHikeCompact.Step>
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ backgroundColor: '#fff',
+ paddingTop: 50,
+ paddingHorizontal: 16,
+ },
+ item: {
+ padding: 16,
+ borderBottomWidth: 1,
+ borderBottomColor: '#ccc',
+ },
+})
+```
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Initialize the Supabase client">
+## 8. Start the app
- Create a helper file at `lib/supabase.ts` to initialize the Supabase client using the environment variables.
+Run the development server and scan the QR code with the Expo Go app on your phone, or press `i` for iOS simulator or `a` for Android emulator.
- The code below uses Expo's localStorage polyfill to persist authentication sessions.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```ts name=lib/supabase.ts
- import 'react-native-url-polyfill/auto'
- import { createClient } from '@supabase/supabase-js'
- import 'expo-sqlite/localStorage/install';
-
- const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL
- const supabasePublishableKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY
-
- export const supabase = createClient(supabaseUrl, supabasePublishableKey, {
- auth: {
- storage: localStorage,
- autoRefreshToken: true,
- persistSession: true,
- detectSessionInUrl: false,
- },
- })
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Replace the contents of `App.tsx` with the following code to fetch and display the instruments from your database.
-
- Use `useEffect` to fetch the data when the component mounts and display the query result using React Native components.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
- ```tsx name=App.tsx
- import { useEffect, useState } from 'react'
- import { StyleSheet, View, FlatList, Text } from 'react-native'
- import { supabase } from './lib/supabase'
-
- export default function App() {
- const [instruments, setInstruments] = useState([])
-
- useEffect(() => {
- getInstruments()
- }, [])
-
- async function getInstruments() {
- const { data } = await supabase.from('instruments').select()
- setInstruments(data)
- }
-
- return (
- <View style={styles.container}>
- <FlatList
- data={instruments}
- keyExtractor={(item) => item.id.toString()}
- renderItem={({ item }) => (
- <Text style={styles.item}>{item.name}</Text>
- )}
- />
- </View>
- )
- }
-
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#fff',
- paddingTop: 50,
- paddingHorizontal: 16,
- },
- item: {
- padding: 16,
- borderBottomWidth: 1,
- borderBottomColor: '#ccc',
- },
- })
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server and scan the QR code with the Expo Go app on your phone, or press `i` for iOS simulator or `a` for Android emulator.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npx expo start
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
-</StepHikeCompact>
+```bash
+npx expo start
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/flask.mdx b/apps/docs/content/guides/getting-started/quickstarts/flask.mdx
index c20e845f9ea..5efde4856a6 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/flask.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/flask.mdx
@@ -2,150 +2,93 @@
title: 'Use Supabase with Python'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Python app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Python app with Flask
- <$Partial path="quickstart_db_setup.mdx" />
+Create a new directory for your Python app and set up a virtual environment.
- </StepHikeCompact.Step>
+```bash
+mkdir my-app && cd my-app
+python3 -m venv venv
+source venv/bin/activate
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install Flask and the Supabase client library
- <StepHikeCompact.Details title="Create a Python app with Flask">
+The fastest way to get started is to use Flask for the web framework and the `supabase-py` client library which provides a convenient interface for working with Supabase from a Python app.
- Create a new directory for your Python app and set up a virtual environment.
+Install both packages using pip.
- </StepHikeCompact.Details>
+```bash
+pip install flask supabase
+```
- <StepHikeCompact.Code>
+<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "" }} />
- ```bash name=Terminal
- mkdir my-app && cd my-app
- python3 -m venv venv
- source venv/bin/activate
- ```
+## 5. Create environment variables file
- </StepHikeCompact.Code>
+Create a `.env` file in your project root and populate it with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true):
- </StepHikeCompact.Step>
+<$CodeTabs>
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install Flask and the Supabase client library">
+```text name=.env
+SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- The fastest way to get started is to use Flask for the web framework and the `supabase-py` client library which provides a convenient interface for working with Supabase from a Python app.
+</$CodeTabs>
- Install both packages using pip.
+## 6. Query data from the app
- </StepHikeCompact.Details>
+Install the `python-dotenv` package to load environment variables:
- <StepHikeCompact.Code>
+```bash
+pip install python-dotenv
+```
- ```bash name=Terminal
- pip install flask supabase
- ```
+Create an `app.py` file and add a route that fetches data from your `instruments` table using the Supabase client.
- </StepHikeCompact.Code>
+```python name=app.py
+import os
+from flask import Flask
+from supabase import create_client, Client
+from dotenv import load_dotenv
- </StepHikeCompact.Step>
+load_dotenv()
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Create Environment Variables file">
+app = Flask(__name__)
- Create a `.env` file in your project root and populate it with your Supabase connection variables:
+supabase: Client = create_client(
+ os.environ.get("SUPABASE_URL"),
+ os.environ.get("SUPABASE_PUBLISHABLE_KEY")
+)
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+def index():
+ response = supabase.table('instruments').select("*").execute()
+ instruments = response.data
+ html = '<h1>Instruments</h1><ul>'
+ for instrument in instruments:
+ html += f'<li>{instrument["name"]}</li>'
+ html += '</ul>'
- </StepHikeCompact.Details>
+ return html
- <StepHikeCompact.Code>
+if __name__ == '__main__':
+ app.run(debug=True)
+```
- <$CodeTabs>
+## 7. Start the app
- ```text name=.env
- SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
+Run the Flask development server, and go to http://localhost:5000 in your browser, you should see the list of instruments.
- </$CodeTabs>
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "", "tab": "" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Install the `python-dotenv` package to load environment variables:
-
- ```bash
- pip install python-dotenv
- ```
-
- Create an `app.py` file and add a route that fetches data from your `instruments` table using the Supabase client.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
- ```python name=app.py
- import os
- from flask import Flask
- from supabase import create_client, Client
- from dotenv import load_dotenv
-
- load_dotenv()
-
- app = Flask(__name__)
-
- supabase: Client = create_client(
- os.environ.get("SUPABASE_URL"),
- os.environ.get("SUPABASE_PUBLISHABLE_KEY")
- )
-
- @app.route('/')
- def index():
- response = supabase.table('instruments').select("*").execute()
- instruments = response.data
-
- html = '<h1>Instruments</h1><ul>'
- for instrument in instruments:
- html += f'<li>{instrument["name"]}</li>'
- html += '</ul>'
-
- return html
-
- if __name__ == '__main__':
- app.run(debug=True)
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the Flask development server, go to http://localhost:5000 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- python app.py
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+python app.py
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx
index 498936ca67f..ab121a5d01c 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx
@@ -2,177 +2,115 @@
title: 'Use Supabase with Flutter'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Flutter app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Flutter app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a Flutter app using the `flutter create` command.
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={2}>
-
- <StepHikeCompact.Details title="Create a Flutter app">
-
- Create a Flutter app using the `flutter create` command. You can skip this step if you already have a working app.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- flutter create my_app
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={3}>
-
- <StepHikeCompact.Details title="Install the Supabase client library">
-
- The fastest way to get started is to use the [`supabase_flutter`](https://pub.dev/packages/supabase_flutter) client library which provides a convenient interface for working with Supabase from a Flutter app.
-
- Open the `pubspec.yaml` file inside your Flutter app and add `supabase_flutter` as a dependency.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```yaml name=pubspec.yaml
- supabase_flutter: ^2.0.0
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={4}>
-
- <StepHikeCompact.Details title="Initialize the Supabase client">
-
- Open `lib/main.dart` and edit the main function to initialize Supabase using your project URL and publishable key:
-
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
-
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```dart name=lib/main.dart
- import 'package:supabase_flutter/supabase_flutter.dart';
-
- Future<void> main() async {
- WidgetsFlutterBinding.ensureInitialized();
-
- await Supabase.initialize(
- url: 'YOUR_SUPABASE_URL',
- publishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY',
- );
- runApp(MyApp());
- }
- ```
+```bash
+flutter create my_app
+```
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "flutter", "tab": "mobiles" }} />
+## 4. Install the Supabase client library
- </StepHikeCompact.Code>
+The fastest way to get started is to use the [`supabase_flutter`](https://pub.dev/packages/supabase_flutter) client library which provides a convenient interface for working with Supabase from a Flutter app.
- </StepHikeCompact.Step>
+Open the `pubspec.yaml` file inside your Flutter app and add `supabase_flutter` as a dependency.
- <StepHikeCompact.Step step={5}>
+```yaml name=pubspec.yaml
+supabase_flutter: ^2.0.0
+```
- <StepHikeCompact.Details title="Query data from the app">
+<$Partial path="api_settings.mdx" variables={{ "framework": "flutter", "tab": "mobiles" }} />
- Use a `FutureBuilder` to fetch the data when the home page loads and display the query result in a `ListView`.
+## 5. Initialize the Supabase client
- Replace the default `MyApp` and `MyHomePage` classes with the following code.
+Open `lib/main.dart` and edit the main function to initialize Supabase using your project URL and publishable key, which you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=flutter&tab=mobiles):
- </StepHikeCompact.Details>
+```dart name=lib/main.dart
+import 'package:supabase_flutter/supabase_flutter.dart';
- <StepHikeCompact.Code>
+Future<void> main() async {
+ WidgetsFlutterBinding.ensureInitialized();
- ```dart name=lib/main.dart
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
+ await Supabase.initialize(
+ url: 'YOUR_SUPABASE_URL',
+ publishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY',
+ );
+ runApp(MyApp());
+}
+```
- @override
- Widget build(BuildContext context) {
- return const MaterialApp(
- title: 'Instruments',
- home: HomePage(),
+## 6. Query data from the app
+
+Use a `FutureBuilder` to fetch the data when the home page loads and display the query result in a `ListView`.
+
+Replace the default `MyApp` and `MyHomePage` classes with the following code.
+
+```dart name=lib/main.dart
+class MyApp extends StatelessWidget {
+ const MyApp({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return const MaterialApp(
+ title: 'Instruments',
+ home: HomePage(),
+ );
+ }
+}
+
+class HomePage extends StatefulWidget {
+ const HomePage({super.key});
+
+ @override
+ State<HomePage> createState() => _HomePageState();
+}
+
+class _HomePageState extends State<HomePage> {
+ final _future = Supabase.instance.client
+ .from('instruments')
+ .select();
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ body: FutureBuilder(
+ future: _future,
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return const Center(child: CircularProgressIndicator());
+ }
+ final instruments = snapshot.data!;
+ return ListView.builder(
+ itemCount: instruments.length,
+ itemBuilder: ((context, index) {
+ final instrument = instruments[index];
+ return ListTile(
+ title: Text(instrument['name']),
+ );
+ }),
);
- }
- }
-
- class HomePage extends StatefulWidget {
- const HomePage({super.key});
-
- @override
- State<HomePage> createState() => _HomePageState();
- }
-
- class _HomePageState extends State<HomePage> {
- final _future = Supabase.instance.client
- .from('instruments')
- .select();
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: FutureBuilder(
- future: _future,
- builder: (context, snapshot) {
- if (!snapshot.hasData) {
- return const Center(child: CircularProgressIndicator());
- }
- final instruments = snapshot.data!;
- return ListView.builder(
- itemCount: instruments.length,
- itemBuilder: ((context, index) {
- final instrument = instruments[index];
- return ListTile(
- title: Text(instrument['name']),
- );
- }),
- );
- },
- ),
- );
- }
- }
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Run your app on a platform of your choosing! By default an app should launch in your web browser.
-
- Note that `supabase_flutter` is compatible with web, iOS, Android, macOS, and Windows apps.
- Running the app on macOS requires additional configuration to [set the entitlements](https://docs.flutter.dev/development/platform-integration/macos/building#setting-up-entitlements).
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
+ },
+ ),
+ );
+ }
+}
+```
- ```bash name=Terminal
- flutter run
- ```
+## 7. Start the app
- </StepHikeCompact.Code>
+Run your app on a platform of your choosing! By default an app should launch in your web browser.
- </StepHikeCompact.Step>
+Note that `supabase_flutter` is compatible with web, iOS, Android, macOS, and Windows apps.
+Running the app on macOS requires additional configuration to [set the entitlements](https://docs.flutter.dev/development/platform-integration/macos/building#setting-up-entitlements).
-</StepHikeCompact>
+```bash
+flutter run
+```
## Setup deep links
diff --git a/apps/docs/content/guides/getting-started/quickstarts/hono.mdx b/apps/docs/content/guides/getting-started/quickstarts/hono.mdx
index 4f81cce2f7f..6e20b75f2f3 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/hono.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/hono.mdx
@@ -2,91 +2,48 @@
title: 'Use Supabase with Hono'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, secure it with auth, and query the data from a Hono app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Hono app
- <StepHikeCompact.Details title="Create a Hono app">
+Bootstrap the Hono example app from the Supabase Samples using the CLI.
- Bootstrap the Hono example app from the Supabase Samples using the CLI.
+```bash
+npx supabase@latest bootstrap hono
+```
- </StepHikeCompact.Details>
+## 4. Install the Supabase client library
- <StepHikeCompact.Code>
+The `package.json` file in the project includes the necessary dependencies, including `@supabase/supabase-js` and `@supabase/ssr` to help with server-side auth.
- ```bash name=Terminal
- npx supabase@latest bootstrap hono
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={2}>
- <StepHikeCompact.Details title="Install the Supabase client library">
-
- The `package.json` file in the project includes the necessary dependencies, including `@supabase/supabase-js` and `@supabase/ssr` to help with server-side auth.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm install
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Set up the required environment variables">
-
- Copy the `.env.example` file to `.env` and update the values with your Supabase project URL and publishable key.
-
- Lastly, [enable anonymous sign-ins](/dashboard/project/_/auth/providers) in the Auth settings.
-
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
-
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
-
- ```bash name=Terminal
- cp .env.example .env
- ```
+```bash
+npm install
+```
{/* TODO: Not ideal for frameworks that have no entry in Connect */}
-<$Partial path="api_settings_steps.mdx" variables={{ "framework": "", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
+<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "frameworks" }} />
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Start the app">
+## 5. Set up the required environment variables
- Start the app, go to http://localhost:5173.
+Copy the `.env.example` file to `.env` and update the values with your Supabase project URL and publishable key, which you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&tab=frameworks).
- Learn how [server side auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=framework&framework=hono) works with Hono.
+Lastly, [enable anonymous sign-ins](/dashboard/project/_/auth/providers) in the Auth settings.
- </StepHikeCompact.Details>
+```bash
+cp .env.example .env
+```
- <StepHikeCompact.Code>
+## 6. Start the app
- ```bash name=Terminal
- npm run dev
- ```
+Start the app, go to http://localhost:5173.
- </StepHikeCompact.Code>
+Learn how [server side auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=framework&framework=hono) works with Hono.
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/ios-swiftui.mdx b/apps/docs/content/guides/getting-started/quickstarts/ios-swiftui.mdx
index d19a1ddb758..9ca27640d1e 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/ios-swiftui.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/ios-swiftui.mdx
@@ -2,146 +2,86 @@
title: 'Use Supabase with iOS and SwiftUI'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from an iOS app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create an iOS SwiftUI app with Xcode
- <$Partial path="quickstart_db_setup.mdx" />
+Select the **Xcode > New Project > iOS > App** menu item.
- </StepHikeCompact.Step>
+## 4. Install the Supabase client library
- <StepHikeCompact.Step step={2}>
+Add the [supabase-swift](https://github.com/supabase/supabase-swift) package to your app using the Swift Package Manager.
- <StepHikeCompact.Details title="Create an iOS SwiftUI app with Xcode">
+In Xcode, navigate to **File > Add Package Dependencies...** and enter the repository URL `https://github.com/supabase/supabase-swift` in the search bar. For detailed instructions, see Apple's [tutorial on adding package dependencies](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).
- Open Xcode > New Project > iOS > App. You can skip this step if you already have a working app.
+Make sure to add `Supabase` product package as a dependency to your application target.
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "swift", "tab": "mobiles" }} />
- </StepHikeCompact.Step>
+## 5. Initialize the Supabase client
- <StepHikeCompact.Step step={3}>
+Create a new `Supabase.swift` file add a new Supabase instance using your project URL and publishable key, which you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=swift&tab=mobiles):
- <StepHikeCompact.Details title="Install the Supabase client library">
+```swift name=Supabase.swift
+import Supabase
- Add the [supabase-swift](https://github.com/supabase/supabase-swift) package to your app using the Swift Package Manager.
+let supabase = SupabaseClient(
+ supabaseURL: URL(string: "YOUR_SUPABASE_URL")!,
+ supabaseKey: "YOUR_SUPABASE_PUBLISHABLE_KEY"
+)
+```
- In Xcode, navigate to **File > Add Package Dependencies...** and enter the repository URL `https://github.com/supabase/supabase-swift` in the search bar. For detailed instructions, see Apple's [tutorial on adding package dependencies](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).
+## 6. Create a data model for instruments
- Make sure to add `Supabase` product package as a dependency to your application target.
+Create a decodable struct to deserialize the data from the database.
- </StepHikeCompact.Details>
+Add the following code to a new file named `Instrument.swift`.
- </StepHikeCompact.Step>
+```swift name=Instrument.swift
+struct Instrument: Decodable, Identifiable {
+ let id: Int
+ let name: String
+}
+```
- <StepHikeCompact.Step step={4}>
+## 7. Query data from the app
- <StepHikeCompact.Details title="Initialize the Supabase client">
+Use a `task` to fetch the data from the database and display it using a `List`.
- Create a new `Supabase.swift` file add a new Supabase instance using your project URL and publishable key:
+Replace the default `ContentView` with the following code.
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+```swift name=ContentView.swift
+import SwiftUI
+struct ContentView: View {
- </StepHikeCompact.Details>
+ @State var instruments: [Instrument] = []
- <StepHikeCompact.Code>
-
- ```swift name=Supabase.swift
- import Supabase
-
- let supabase = SupabaseClient(
- supabaseURL: URL(string: "YOUR_SUPABASE_URL")!,
- supabaseKey: "YOUR_SUPABASE_PUBLISHABLE_KEY"
- )
- ```
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "swift", "tab": "mobiles" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
-
- <StepHikeCompact.Details title="Create a data model for instruments">
-
- Create a decodable struct to deserialize the data from the database.
-
- Add the following code to a new file named `Instrument.swift`.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```swift name=Instrument.swift
- struct Instrument: Decodable, Identifiable {
- let id: Int
- let name: String
+ var body: some View {
+ List(instruments) { instrument in
+ Text(instrument.name)
+ }
+ .overlay {
+ if instruments.isEmpty {
+ ProgressView()
}
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
-
- <StepHikeCompact.Details title="Query data from the app">
-
- Use a `task` to fetch the data from the database and display it using a `List`.
-
- Replace the default `ContentView` with the following code.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```swift name=ContentView.swift
- import SwiftUI
-
- struct ContentView: View {
-
- @State var instruments: [Instrument] = []
-
- var body: some View {
- List(instruments) { instrument in
- Text(instrument.name)
- }
- .overlay {
- if instruments.isEmpty {
- ProgressView()
- }
- }
- .task {
- do {
- instruments = try await supabase.from("instruments").select().execute().value
- } catch {
- dump(error)
- }
- }
- }
+ }
+ .task {
+ do {
+ instruments = try await supabase.from("instruments").select().execute().value
+ } catch {
+ dump(error)
}
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the app on a simulator or a physical device by hitting `Cmd + R` on Xcode.
-
- </StepHikeCompact.Details>
+ }
+ }
+}
+```
- </StepHikeCompact.Step>
+## 8. Start the app
-</StepHikeCompact>
+Run the app on a simulator or a physical device by hitting `Cmd + R` on Xcode.
## Setting up deep links
diff --git a/apps/docs/content/guides/getting-started/quickstarts/kotlin.mdx b/apps/docs/content/guides/getting-started/quickstarts/kotlin.mdx
index c1684011415..d712b5f87a0 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/kotlin.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/kotlin.mdx
@@ -2,189 +2,139 @@
title: 'Use Supabase with Android Kotlin'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from an Android Kotlin app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create an Android app with Android Studio
- <$Partial path="quickstart_db_setup.mdx" />
+Select the **Android Studio > New > New Android Project** menu item.
- </StepHikeCompact.Step>
+## 4. Install dependencies
- <StepHikeCompact.Step step={2}>
+Open `build.gradle.kts` (app) file and add the serialization plugin, Ktor client, and Supabase client.
- <StepHikeCompact.Details title="Create an Android app with Android Studio">
- Open Android Studio > New > New Android Project.
+Replace the version placeholders `$kotlin_version` with the Kotlin version of the project, and `$supabase_version` and `$ktor_version` with the respective latest versions.
- </StepHikeCompact.Details>
+<Admonition type="tip">
- </StepHikeCompact.Step>
+You can find the latest supabase-kt version [on GitHub](https://github.com/supabase-community/supabase-kt/releases) and Ktor [in the Ktor documentation](https://ktor.io/docs/welcome.html).
- <StepHikeCompact.Step step={3}>
+</Admonition>
- <StepHikeCompact.Details title="Install the Dependencies">
- Open `build.gradle.kts` (app) file and add the serialization plug, Ktor client, and Supabase client.
+```kotlin
+plugins {
+ ...
+ kotlin("plugin.serialization") version "$kotlin_version"
+}
+...
+dependencies {
+ ...
+ implementation(platform("io.github.jan-tennert.supabase:bom:$supabase_version"))
+ implementation("io.github.jan-tennert.supabase:postgrest-kt")
+ implementation("io.ktor:ktor-client-android:$ktor_version")
+}
+```
- Replace the version placeholders `$kotlin_version` with the Kotlin version of the project, and `$supabase_version` and `$ktor_version` with the respective latest versions.
+## 5. Add internet access permission
- The latest supabase-kt version can be found [here](https://github.com/supabase-community/supabase-kt/releases) and Ktor version can be found [here](https://ktor.io/docs/welcome.html).
+Add the following line to the `AndroidManifest.xml` file under the `manifest` tag and outside the `application` tag.
- </StepHikeCompact.Details>
+```xml
+...
+<uses-permission android:name="android.permission.INTERNET" />
+...
+```
- <StepHikeCompact.Code>
- ```kotlin
- plugins {
- ...
- kotlin("plugin.serialization") version "$kotlin_version"
- }
- ...
- dependencies {
- ...
- implementation(platform("io.github.jan-tennert.supabase:bom:$supabase_version"))
- implementation("io.github.jan-tennert.supabase:postgrest-kt")
- implementation("io.ktor:ktor-client-android:$ktor_version")
- }
- ```
+<$Partial path="api_settings.mdx" variables={{ "framework": "androidkotlin", "tab": "mobiles" }} />
- </StepHikeCompact.Code>
+## 6. Initialize the Supabase client
- </StepHikeCompact.Step>
+You can create a Supabase client whenever you need to perform an API call.
- <StepHikeCompact.Step step={4}>
+For a quick example, create a client at the top of the `MainActivity.kt` file below the imports.
- <StepHikeCompact.Details title="Add internet access permission">
- Add the following line to the `AndroidManifest.xml` file under the `manifest` tag and outside the `application` tag.
- </StepHikeCompact.Details>
+Replace the `supabaseUrl` and `supabaseKey` with your own, which you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=androidkotlin&tab=mobiles):
- <StepHikeCompact.Code>
- ```xml
- ...
- <uses-permission android:name="android.permission.INTERNET" />
- ...
- ```
+```kotlin
+import ...
- </StepHikeCompact.Code>
+val supabase = createSupabaseClient(
+ supabaseUrl = "https://xyzcompany.supabase.co",
+ supabaseKey = "your_publishable_key"
+ ) {
+ install(Postgrest)
+}
+...
+```
- </StepHikeCompact.Step>
+## 7. Create a data model for instruments
- <StepHikeCompact.Step step={5}>
+Create a serializable data class to represent the data from the database.
- <StepHikeCompact.Details title="Initialize the Supabase client">
- You can create a Supabase client whenever you need to perform an API call.
+Add the following below the `createSupabaseClient` function in the `MainActivity.kt` file.
- For the sake of simplicity, we will create a client in the `MainActivity.kt` file at the top below the imports.
+```kotlin
+@Serializable
+data class Instrument(
+ val id: Int,
+ val name: String,
+)
+```
- Replace the `supabaseUrl` and `supabaseKey` with your own:
+## 8. Query data from the app
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+Use `LaunchedEffect` to fetch data from the database and display it in a `LazyColumn`.
+Replace the default `MainActivity` class with the following code.
- </StepHikeCompact.Details>
+<Admonition type="note">
- <StepHikeCompact.Code>
+This example application makes a network request from the UI code. In production, you should use a `ViewModel` to separate the UI and data fetching logic.
- ```kotlin
- import ...
+</Admonition>
- val supabase = createSupabaseClient(
- supabaseUrl = "https://xyzcompany.supabase.co",
- supabaseKey = "your_publishable_key"
- ) {
- install(Postgrest)
- }
- ...
- ```
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "androidkotlin", "tab": "mobiles" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
-
- <StepHikeCompact.Details title="Create a data model for instruments">
- Create a serializable data class to represent the data from the database.
-
- Add the following below the `createSupabaseClient` function in the `MainActivity.kt` file.
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
- ```kotlin
- @Serializable
- data class Instrument(
- val id: Int,
- val name: String,
- )
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
-
- <StepHikeCompact.Details title="Query data from the app">
- Use `LaunchedEffect` to fetch data from the database and display it in a `LazyColumn`.
-
- Replace the default `MainActivity` class with the following code.
-
- Note that we are making a network request from our UI code. In production, you should probably use a `ViewModel` to separate the UI and data fetching logic.
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
- ```kotlin
- class MainActivity : ComponentActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContent {
- SupabaseTutorialTheme {
- // A surface container using the 'background' color from the theme
- Surface(
- modifier = Modifier.fillMaxSize(),
- color = MaterialTheme.colorScheme.background
- ) {
- InstrumentsList()
- }
- }
- }
- }
- }
-
- @Composable
- fun InstrumentsList() {
- var instruments by remember { mutableStateOf<List<Instrument>>(listOf()) }
- LaunchedEffect(Unit) {
- withContext(Dispatchers.IO) {
- instruments = supabase.from("instruments")
- .select().decodeList<Instrument>()
- }
- }
- LazyColumn {
- items(
- instruments,
- key = { instrument -> instrument.id },
- ) { instrument ->
- Text(
- instrument.name,
- modifier = Modifier.padding(8.dp),
- )
- }
- }
- }
- ```
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={8}>
- <StepHikeCompact.Details title="Start the app">
- Run the app on an emulator or a physical device by clicking the `Run app` button in Android Studio.
- </StepHikeCompact.Details>
-
- </StepHikeCompact.Step>
-
-</StepHikeCompact>
+```kotlin
+class MainActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContent {
+ SupabaseTutorialTheme {
+ // A surface container using the 'background' color from the theme
+ Surface(
+ modifier = Modifier.fillMaxSize(),
+ color = MaterialTheme.colorScheme.background
+ ) {
+ InstrumentsList()
+ }
+ }
+ }
+ }
+}
+
+@Composable
+fun InstrumentsList() {
+ var instruments by remember { mutableStateOf<List<Instrument>>(listOf()) }
+ LaunchedEffect(Unit) {
+ withContext(Dispatchers.IO) {
+ instruments = supabase.from("instruments")
+ .select().decodeList<Instrument>()
+ }
+ }
+ LazyColumn {
+ items(
+ instruments,
+ key = { instrument -> instrument.id },
+ ) { instrument ->
+ Text(
+ instrument.name,
+ modifier = Modifier.padding(8.dp),
+ )
+ }
+ }
+}
+```
+
+## 9. Start the app
+
+Run the app on an emulator or a physical device by clicking the `Run app` button in Android Studio.
diff --git a/apps/docs/content/guides/getting-started/quickstarts/laravel.mdx b/apps/docs/content/guides/getting-started/quickstarts/laravel.mdx
index 6e7744279bf..d66857b498b 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/laravel.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/laravel.mdx
@@ -2,144 +2,87 @@
title: 'Use Supabase with Laravel'
subtitle: 'Learn how to create a PHP Laravel project, connect it to your Supabase Postgres database, and configure user authentication.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
- <StepHikeCompact.Details title="Create a Laravel Project">
+## 3. Create a Laravel project
- Make sure your PHP and Composer versions are up to date, then use `composer create-project` to scaffold a new Laravel project.
+Make sure your PHP and Composer versions are up to date, then use `composer create-project` to scaffold a new Laravel project.
- See the [Laravel docs](https://laravel.com/docs/10.x/installation#creating-a-laravel-project) for more details.
+See the [Laravel docs](https://laravel.com/docs/10.x/installation#creating-a-laravel-project) for more details.
- </StepHikeCompact.Details>
+```bash
+composer create-project laravel/laravel example-app
+```
- <StepHikeCompact.Code>
+## 4. Install the authentication template
- ```bash name=Terminal
- composer create-project laravel/laravel example-app
- ```
+Install [Laravel Breeze](https://laravel.com/docs/10.x/starter-kits#laravel-breeze), a basic implementation of all of Laravel's [authentication features](https://laravel.com/docs/10.x/authentication).
- </StepHikeCompact.Code>
+```bash
+composer require laravel/breeze --dev
+php artisan breeze:install
+```
- </StepHikeCompact.Step>
+## 5. Set up the Postgres connection details
- <StepHikeCompact.Step step={2}>
- <StepHikeCompact.Details title="Install the Authentication template">
+Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely.
- Install [Laravel Breeze](https://laravel.com/docs/10.x/starter-kits#laravel-breeze), a basic implementation of all of Laravel's [authentication features](https://laravel.com/docs/10.x/authentication).
+When your project is up and running, navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&method=session).
- </StepHikeCompact.Details>
+Look for the Session Pooler connection string and copy the string. You will need to replace the Password with your saved database password. You can reset your database password in your [Database Settings](/dashboard/project/_/database/settings) if you do not have it.
- <StepHikeCompact.Code>
+<Admonition type="note">
- ```bash name=Terminal
- composer require laravel/breeze --dev
- php artisan breeze:install
- ```
+If you're in an [IPv6 environment](https://github.com/orgs/supabase/discussions/27034) or have the IPv4 Add-On, you can use the direct connection string instead of Supavisor in Session mode.
- </StepHikeCompact.Code>
+</Admonition>
- </StepHikeCompact.Step>
+```bash name=.env
+DB_CONNECTION=pgsql
+DB_URL=postgres://postgres.xxxx:[email protected]:5432/postgres
+```
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Set up the Postgres connection details">
+## 6. Change the default schema
- Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely.
+By default Laravel uses the `public` schema. We recommend changing this as Supabase exposes the `public` schema as a [data API](/docs/guides/api).
- When your project is up and running, navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&method=session).
+You can change the schema of your Laravel application by modifying the `search_path` variable `app/config/database.php`.
- Look for the Session Pooler connection string and copy the string. You will need to replace the Password with your saved database password. You can reset your database password in your [Database Settings](/dashboard/project/_/database/settings) if you do not have it.
+The schema you specify in `search_path` has to exist on Supabase. You can create a new schema from the [Table Editor](/dashboard/project/_/editor).
- <Admonition type="note">
+```php name=app/config/database.php
+'pgsql' => [
+ 'driver' => 'pgsql',
+ 'url' => env('DB_URL'),
+ 'host' => env('DB_HOST', '127.0.0.1'),
+ 'port' => env('DB_PORT', '5432'),
+ 'database' => env('DB_DATABASE', 'laravel'),
+ 'username' => env('DB_USERNAME', 'root'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'charset' => env('DB_CHARSET', 'utf8'),
+ 'prefix' => '',
+ 'prefix_indexes' => true,
+ 'search_path' => 'laravel',
+ 'sslmode' => 'prefer',
+],
+```
- If you're in an [IPv6 environment](https://github.com/orgs/supabase/discussions/27034) or have the IPv4 Add-On, you can use the direct connection string instead of Supavisor in Session mode.
+## 7. Run the database migrations
- </Admonition>
+Laravel ships with database migration files that set up the required tables for Laravel Authentication and User Management.
- </StepHikeCompact.Details>
+Note: Laravel does not use Supabase Auth but rather implements its own authentication system!
- <StepHikeCompact.Code>
+```bash
+php artisan migrate
+```
- ```bash name=.env
- DB_CONNECTION=pgsql
- DB_URL=postgres://postgres.xxxx:[email protected]:5432/postgres
- ```
+## 8. Start the app
- </StepHikeCompact.Code>
+Run the development server. Go to http://127.0.0.1:8000 in a browser to see your application. You can also navigate to http://127.0.0.1:8000/register and http://127.0.0.1:8000/login to register and log in users.
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Change the default schema">
-
- By default Laravel uses the `public` schema. We recommend changing this as Supabase exposes the `public` schema as a [data API](/docs/guides/api).
-
- You can change the schema of your Laravel application by modifying the `search_path` variable `app/config/database.php`.
-
- The schema you specify in `search_path` has to exist on Supabase. You can create a new schema from the [Table Editor](/dashboard/project/_/editor).
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```php name=app/config/database.php
- 'pgsql' => [
- 'driver' => 'pgsql',
- 'url' => env('DB_URL'),
- 'host' => env('DB_HOST', '127.0.0.1'),
- 'port' => env('DB_PORT', '5432'),
- 'database' => env('DB_DATABASE', 'laravel'),
- 'username' => env('DB_USERNAME', 'root'),
- 'password' => env('DB_PASSWORD', ''),
- 'charset' => env('DB_CHARSET', 'utf8'),
- 'prefix' => '',
- 'prefix_indexes' => true,
- 'search_path' => 'laravel',
- 'sslmode' => 'prefer',
- ],
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Run the database migrations">
-
- Laravel ships with database migration files that set up the required tables for Laravel Authentication and User Management.
-
- Note: Laravel does not use Supabase Auth but rather implements its own authentication system!
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- php artisan migrate
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server. Go to http://127.0.0.1:8000 in a browser to see your application. You can also navigate to http://127.0.0.1:8000/register and http://127.0.0.1:8000/login to register and log in users.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- php artisan serve
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
-</StepHikeCompact>
+```bash
+php artisan serve
+```
diff --git a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
index fab3593778d..e3b46fd890e 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
@@ -2,125 +2,72 @@
title: 'Use Supabase with Next.js'
subtitle: 'Learn how to create a Supabase project, add some sample data, and query from a Next.js app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Next.js app
- <$Partial path="quickstart_db_setup.mdx" />
+Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with [Cookie-based Auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server), [TypeScript](https://www.typescriptlang.org/), and [Tailwind CSS](https://tailwindcss.com/).
- </StepHikeCompact.Step>
+```bash
+npx create-next-app -e with-supabase
+```
- <StepHikeCompact.Step step={2}>
+<$Partial path="api_settings.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
- <StepHikeCompact.Details title="Create a Next.js app">
+## 4. Declare Supabase environment variables
- Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with:
- - [Cookie-based Auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- - [TypeScript](https://www.typescriptlang.org/)
- - [Tailwind CSS](https://tailwindcss.com/)
+Rename `.env.example` to `.env.local` and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=nextjs&tab=frameworks):
- <$Partial path="uiLibCta.mdx" />
+<$CodeTabs>
-</StepHikeCompact.Details>
+```text name=.env.local
+NEXT_PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Code>
+</$CodeTabs>
- ```bash
- npx create-next-app -e with-supabase
- ```
+## 5. Query Supabase data from Next.js
- </StepHikeCompact.Code>
+<$Partial path="uiLibCta.mdx" />
- </StepHikeCompact.Step>
+Create a new file at `app/instruments/page.tsx` and populate with the following.
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+This selects all the rows from the `instruments` table you created earlier and renders them on the page.
- Rename `.env.example` to `.env.local` and populate with your Supabase connection variables:
+<$CodeTabs>
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+```ts name=app/instruments/page.tsx
+import { createClient } from "@/lib/supabase/server";
+import { Suspense } from "react";
+async function InstrumentsData() {
+ const supabase = await createClient();
+ const { data: instruments } = await supabase.from("instruments").select();
- </StepHikeCompact.Details>
+ return <pre>{JSON.stringify(instruments, null, 2)}</pre>;
+}
- <StepHikeCompact.Code>
+export default function Instruments() {
+ return (
+ <Suspense fallback={<div>Loading instruments...</div>}>
+ <InstrumentsData />
+ </Suspense>
+ );
+}
+```
- <$CodeTabs>
+</$CodeTabs>
- ```text name=.env.local
- NEXT_PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
+## 6. Start the app
- </$CodeTabs>
+Run the development server, go to http://localhost:3000/instruments in a browser and you should see the list of instruments.
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "nextjs", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Query Supabase data from Next.js">
-
- Create a new file at `app/instruments/page.tsx` and populate with the following.
-
- This selects all the rows from the `instruments` table in Supabase and render them on the page.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```ts name=app/instruments/page.tsx
- import { createClient } from "@/lib/supabase/server";
- import { Suspense } from "react";
-
- async function InstrumentsData() {
- const supabase = await createClient();
- const { data: instruments } = await supabase.from("instruments").select();
-
- return <pre>{JSON.stringify(instruments, null, 2)}</pre>;
- }
-
- export default function Instruments() {
- return (
- <Suspense fallback={<div>Loading instruments...</div>}>
- <InstrumentsData />
- </Suspense>
- );
- }
- ```
-
- </$CodeTabs>
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server, go to http://localhost:3000/instruments in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
-</StepHikeCompact>
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx
index cb1ce765b79..150f90b437e 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/nuxtjs.mdx
@@ -2,148 +2,90 @@
title: 'Use Supabase with Nuxt'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Nuxt app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Nuxt app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a Nuxt app using the `npx nuxi` command.
- </StepHikeCompact.Step>
+```bash
+npx nuxi@latest init my-app
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a Nuxt 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 Nuxt app.
- - Create a Nuxt app using the `npx nuxi` command.
+Navigate to the Nuxt app and install `supabase-js`.
- <$Partial path="uiLibCta.mdx" />
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "nuxt", "tab": "frameworks" }} />
- <StepHikeCompact.Code>
+## 5. Declare Supabase environment variables
- ```bash name=Terminal
- npx nuxi@latest init my-app
- ```
+Create a `.env` file and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=nuxt&tab=frameworks):
- </StepHikeCompact.Code>
+<$CodeTabs>
- </StepHikeCompact.Step>
+```text name=.env
+SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+```ts name=nuxt.config.ts
+export default defineNuxtConfig({
+ runtimeConfig: {
+ public: {
+ supabaseUrl: process.env.SUPABASE_URL,
+ supabasePublishableKey: process.env.SUPABASE_PUBLISHABLE_KEY,
+ },
+ },
+})
+```
- 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 Nuxt app.
+</$CodeTabs>
- Navigate to the Nuxt app and install `supabase-js`.
+## 6. Query data from the app
- </StepHikeCompact.Details>
+In `app.vue`, create a Supabase client using your config values and replace the existing content with the following code.
- <StepHikeCompact.Code>
+```vue name=app.vue
+<script setup>
+import { createClient } from '@supabase/supabase-js'
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+const config = useRuntimeConfig()
+const supabase = createClient(config.public.supabaseUrl, config.public.supabasePublishableKey)
+const instruments = ref([])
- </StepHikeCompact.Code>
+async function getInstruments() {
+ const { data } = await supabase.from('instruments').select()
+ instruments.value = data
+}
- </StepHikeCompact.Step>
+onMounted(() => {
+ getInstruments()
+})
+</script>
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+<template>
+ <ul>
+ <li v-for="instrument in instruments" :key="instrument.id">{{ instrument.name }}</li>
+ </ul>
+</template>
+```
- Create a `.env` file and populate with your Supabase connection variables:
+## 7. Start the app
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+Start the app, navigate to http://localhost:3000 in the browser, and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```text name=.env.local
- SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
-
- ```ts name=nuxt.config.tsx
- export default defineNuxtConfig({
- runtimeConfig: {
- public: {
- supabaseUrl: process.env.SUPABASE_URL,
- supabasePublishableKey: process.env.SUPABASE_PUBLISHABLE_KEY,
- },
- },
- });
- ```
-
- </$CodeTabs>
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "nuxt", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Query data from the app">
-
- In `app.vue`, create a Supabase client using your config values and replace the existing content with the following code.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```vue name=app.vue
- <script setup>
- import { createClient } from '@supabase/supabase-js'
- const config = useRuntimeConfig()
- const supabase = createClient(config.public.supabaseUrl, config.public.supabasePublishableKey)
- const instruments = ref([])
-
- async function getInstruments() {
- const { data } = await supabase.from('instruments').select()
- instruments.value = data
- }
-
- onMounted(() => {
- getInstruments()
- })
- </script>
-
- <template>
- <ul>
- <li v-for="instrument in instruments" :key="instrument.id">{{ instrument.name }}</li>
- </ul>
- </template>
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Start the app, navigate to http://localhost:3000 in the browser, open the browser console, and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
<Admonition type="tip">
diff --git a/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx
index 66d9743c162..5e8e29d920b 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/reactjs.mdx
@@ -2,149 +2,91 @@
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
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a React app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a React app using a [Vite](https://vitejs.dev/guide/) template.
- </StepHikeCompact.Step>
+```bash
+npm create vite@latest my-app -- --template react
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a React 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 React app.
- - Create a React app using a [Vite](https://vitejs.dev/guide/) template.
+Navigate to the React app and install `supabase-js`.
- <$Partial path="uiLibCta.mdx" />
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "react", "tab": "frameworks" }} />
- <StepHikeCompact.Code>
+## 5. Declare Supabase environment variables
- ```bash name=Terminal
- npm create vite@latest my-app -- --template react
- ```
+Create a `.env.local` file and populate it with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=react&tab=frameworks):
- </StepHikeCompact.Code>
+```text name=.env.local
+VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- </StepHikeCompact.Step>
+## 6. Query data from the app
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+<$Partial path="uiLibCta.mdx" />
- 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.
+Replace the contents of `App.jsx` with a `getInstruments` function that fetches the data and displays the query result on the page using a Supabase client.
- Navigate to the React app and install `supabase-js`.
+```js name=src/App.jsx
+import { createClient } from '@supabase/supabase-js'
+import { useEffect, useState } from 'react'
- </StepHikeCompact.Details>
+const supabase = createClient(
+ import.meta.env.VITE_SUPABASE_URL,
+ import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
+)
- <StepHikeCompact.Code>
+function App() {
+ const [instruments, setInstruments] = useState([])
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+ useEffect(() => {
+ getInstruments()
+ }, [])
- </StepHikeCompact.Code>
+ async function getInstruments() {
+ const { data, error } = await supabase.from('instruments').select()
- </StepHikeCompact.Step>
+ if (error) {
+ console.error(error)
+ return
+ }
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+ setInstruments(data)
+ }
- Create a `.env.local` file and populate with your Supabase connection variables:
+ return (
+ <ul>
+ {instruments.map((instrument) => (
+ <li key={instrument.name}>{instrument.name}</li>
+ ))}
+ </ul>
+ )
+}
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+export default App
+```
+## 7. Start the app
- </StepHikeCompact.Details>
+Run the development server, go to http://localhost:5173 in a browser, and you should see the list of instruments.
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```text name=.env.local
- VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
-
- </$CodeTabs>
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "react", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Replace the contents of `App.jsx` to add a `getInstruments` function to fetch the data and display the query result to the page using a Supabase client.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
- ```js name=src/App.jsx
- import { useEffect, useState } from "react";
- import { createClient } from "@supabase/supabase-js";
-
- const supabase = createClient(import.meta.env.VITE_SUPABASE_URL, import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY);
-
- function App() {
- const [instruments, setInstruments] = useState([]);
-
- useEffect(() => {
- getInstruments();
- }, []);
-
- async function getInstruments() {
- const { data, error } = await supabase.from("instruments").select();
-
- if (error) {
- console.error(error);
- return;
- }
-
- setInstruments(data);
- }
-
- return (
- <ul>
- {instruments.map((instrument) => (
- <li key={instrument.name}>{instrument.name}</li>
- ))}
- </ul>
- );
- }
-
- export default App;
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server, go to http://localhost:5173 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx
index 151e655d6ac..d98de59234b 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx
@@ -2,230 +2,154 @@
title: 'Use Supabase with RedwoodJS'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database using Prisma migration and seeds, and query the data from a RedwoodJS app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+## 1. Setup your new Supabase project
- <StepHikeCompact.Step step={1}>
- <StepHikeCompact.Details title="Setup your new Supabase Project">
- [Create a new project](/dashboard) in the Supabase Dashboard.
+[Create a new project](/dashboard) in the Supabase Dashboard.
- <Admonition type="tip">
+<Admonition type="tip">
- Be sure to make note of the Database Password you used as you will need this later to connect to your database.
+Be sure to make note of the Database Password you used as you will need this later to connect to your database.
- </Admonition>
- </StepHikeCompact.Details>
+</Admonition>
- <StepHikeCompact.Code>
- ![New project for redwoodjs](/docs/img/guides/getting-started/quickstarts/redwoodjs/new-project.png)
- </StepHikeCompact.Code>
+![New project for redwoodjs](/docs/img/guides/getting-started/quickstarts/redwoodjs/new-project.png)
- </StepHikeCompact.Step>
+## 2. Gather database connection strings
- <StepHikeCompact.Step step={2}>
- <StepHikeCompact.Details title="Gather Database Connection Strings">
+Open the project [**Connect** panel](/dashboard/project/_?showConnect=true). This quickstart connects using the [**Transaction pooler**](/dashboard/project/_?showConnect=true&method=transaction) and [**Session pooler**](/dashboard/project/_?showConnect=true&method=session) mode. Transaction mode is used for application queries and Session mode is used for running migrations with Prisma.
- Open the project [**Connect** panel](/dashboard/project/_?showConnect=true). This quickstart connects using the [**Transaction pooler**](/dashboard/project/_?showConnect=true&method=transaction) and [**Session pooler**](/dashboard/project/_?showConnect=true&method=session) mode. Transaction mode is used for application queries and Session mode is used for running migrations with Prisma.
+To do this, set the connection mode to `Transaction` in the [Database Settings page](/dashboard/project/_/database/settings) and copy the connection string and append `?pgbouncer=true&connection_limit=1`. `pgbouncer=true` disables Prisma from generating prepared statements. This is required since our connection pooler does not support prepared statements in transaction mode yet. The `connection_limit=1` parameter is only required if you are using Prisma from a serverless environment. This is the Transaction mode connection string.
- To do this, set the connection mode to `Transaction` in the [Database Settings page](/dashboard/project/_/database/settings) and copy the connection string and append `?pgbouncer=true&&connection_limit=1`. `pgbouncer=true` disables Prisma from generating prepared statements. This is required since our connection pooler does not support prepared statements in transaction mode yet. The `connection_limit=1` parameter is only required if you are using Prisma from a serverless environment. This is the Transaction mode connection string.
+To get the Session mode connection pooler string, change the port of the connection string from the dashboard to 5432.
- To get the Session mode connection pooler string, change the port of the connection string from the dashboard to 5432.
+You will need the Transaction mode connection string and the Session mode connection string to set up environment variables in Step 4.
- You will need the Transaction mode connection string and the Session mode connection string to setup environment variables in Step 5.
+<Admonition type="tip">
- <Admonition type="tip">
+You can copy and paste these connection strings from the Supabase Dashboard when needed in later steps.
- You can copy and paste these connection strings from the Supabase Dashboard when needed in later steps.
+</Admonition>
- </Admonition>
- </StepHikeCompact.Details>
+![pooled connection for redwoodjs](/docs/img/guides/getting-started/quickstarts/redwoodjs/pooled-connection-strings.png)
- <StepHikeCompact.Code>
- ![pooled connection for redwoodjs](/docs/img/guides/getting-started/quickstarts/redwoodjs/pooled-connection-strings.png)
- </StepHikeCompact.Code>
+## 3. Create a RedwoodJS app
- </StepHikeCompact.Step>
+Create a RedwoodJS app with TypeScript.
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Create a RedwoodJS app">
- Create a RedwoodJS app with TypeScript.
+<Admonition type="note">
- <Admonition type="note">
+The [`yarn` package manager](https://yarnpkg.com) is required to create a RedwoodJS app. You will use it to run RedwoodJS commands later.
- The [`yarn` package manager](https://yarnpkg.com) is required to create a RedwoodJS app. You will use it to run RedwoodJS commands later.
+While TypeScript is recommended, If you want a JavaScript app, omit the `--ts` flag.
- While TypeScript is recommended, If you want a JavaScript app, omit the `--ts` flag.
+</Admonition>
- </Admonition>
- </StepHikeCompact.Details>
+```bash
+yarn create redwood-app my-app --ts
+```
- <StepHikeCompact.Code>
- ```bash name=Terminal
- yarn create redwood-app my-app --ts
- ```
- </StepHikeCompact.Code>
+## 4. Configure environment variables
- </StepHikeCompact.Step>
+In your `.env` file, add the following environment variables for your database connection:
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Open your RedwoodJS app in VS Code">
- You'll develop your app, manage database migrations, and run your app in VS Code.
- </StepHikeCompact.Details>
+- The `DATABASE_URL` should use the Transaction mode connection string you copied in Step 2.
- <StepHikeCompact.Code>
- ```bash name=Terminal
- cd my-app
- code .
- ```
- </StepHikeCompact.Code>
+- The `DIRECT_URL` should use the Session mode connection string you copied in Step 2.
- </StepHikeCompact.Step>
+```bash name=.env
+# Transaction mode connection string used for migrations
+DATABASE_URL="postgres://postgres.[project-ref]:[db-password]@xxx.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Configure Environment Variables">
+# Session mode connection string — used by Prisma Client
+DIRECT_URL="postgres://postgres.[project-ref]:[db-password]@xxx.pooler.supabase.com:5432/postgres"
+```
- In your `.env` file, add the following environment variables for your database connection:
+## 5. Update your Prisma schema
- * The `DATABASE_URL` should use the Transaction mode connection string you copied in Step 1.
+By default, RedwoodJS ships with a SQLite database, but we want to use Postgres.
- * The `DIRECT_URL` should use the Session mode connection string you copied in Step 1.
+Update your Prisma schema file `api/db/schema.prisma` to use your Supabase Postgres database connection environment variables you set up in Step 4.
- </StepHikeCompact.Details>
+```prisma name=api/db/schema.prisma
+datasource db {
+ provider = "postgresql"
+ url = env("DATABASE_URL")
+ directUrl = env("DIRECT_URL")
+}
+```
- <StepHikeCompact.Code>
- ```bash name=.env
- # Transaction mode connection string used for migrations
- DATABASE_URL="postgres://postgres.[project-ref]:[db-password]@xxx.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
+## 6. Create the instrument model and apply a schema migration
- # Session mode connection string — used by Prisma Client
- DIRECT_URL="postgres://postgres.[project-ref]:[db-password]@xxx.pooler.supabase.com:5432/postgres"
- ```
- </StepHikeCompact.Code>
+Create the Instrument model in `api/db/schema.prisma` and then run `yarn rw prisma migrate dev` from your terminal to apply the migration.
- </StepHikeCompact.Step>
+```prisma name=api/db/schema.prisma
+model Instrument {
+ id Int @id @default(autoincrement())
+ name String @unique
+}
+```
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Update your Prisma Schema">
- By default, RedwoodJS ships with a SQLite database, but we want to use Postgres.
+## 7. Update seed script
- Update your Prisma schema file `api/db/schema.prisma` to use your Supabase Postgres database connection environment variables you setup in Step 5.
- </StepHikeCompact.Details>
+Seed the database with a few instruments.
- <StepHikeCompact.Code>
- ```prisma name=api/db/schema.prisma
- datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- directUrl = env("DIRECT_URL")
- }
- ```
- </StepHikeCompact.Code>
+Update the file `scripts/seed.ts` to contain the following code:
- </StepHikeCompact.Step>
+```ts name=scripts/seed.ts
+import type { Prisma } from '@prisma/client'
+import { db } from 'api/src/lib/db'
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Create the Instrument model and apply a schema migration">
- Create the Instrument model in `api/db/schema.prisma` and then run `yarn rw prisma migrate dev` from your terminal to apply the migration.
- </StepHikeCompact.Details>
+export default async () => {
+ try {
+ const data: Prisma.InstrumentCreateArgs['data'][] = [
+ { name: 'dulcimer' },
+ { name: 'harp' },
+ { name: 'guitar' },
+ ]
- <StepHikeCompact.Code>
- ```prisma name=api/db/schema.prisma
- model Instrument {
- id Int @id @default(autoincrement())
- name String @unique
- }
- ```
- </StepHikeCompact.Code>
+ console.log('Seeding instruments ...')
- </StepHikeCompact.Step>
+ const instruments = await db.instrument.createMany({ data })
- <StepHikeCompact.Step step={8}>
- <StepHikeCompact.Details title="Update seed script">
- Seed the database with a few instruments.
+ console.log('Done.', instruments)
+ } catch (error) {
+ console.error(error)
+ }
+}
+```
- Update the file `scripts/seed.ts` to contain the following code:
- </StepHikeCompact.Details>
+## 8. Seed your database
- <StepHikeCompact.Code>
+Run the seed database command to populate the `Instrument` table with the instruments you created.
- ```ts name=scripts/seed.ts
- import type { Prisma } from '@prisma/client'
- import { db } from 'api/src/lib/db'
+<Admonition type="tip">
- export default async () => {
- try {
- const data: Prisma.InstrumentCreateArgs['data'][] = [
- { name: 'dulcimer' },
- { name: 'harp' },
- { name: 'guitar' },
- ]
+The reset database command `yarn rw prisma db reset` recreates the tables and also runs the seed script.
- console.log('Seeding instruments ...')
+</Admonition>
- const instruments = await db.instrument.createMany({ data })
+```bash
+yarn rw prisma db seed
+```
- console.log('Done.', instruments)
- } catch (error) {
- console.error(error)
- }
- }
- ```
- </StepHikeCompact.Code>
+## 9. Scaffold the instrument UI
- </StepHikeCompact.Step>
+Use RedwoodJS generators to scaffold a CRUD UI for the `Instrument` model.
- <StepHikeCompact.Step step={9}>
- <StepHikeCompact.Details title="Seed your database">
- Run the seed database command to populate the `Instrument` table with the instruments you created.
+```bash
+yarn rw g scaffold instrument
+```
- <Admonition type="tip">
+## 10. Start the app
- The reset database command `yarn rw prisma db reset` will recreate the tables and will also run the seed script.
+Start the app via `yarn rw dev`. A browser will open to the RedwoodJS Splash page.
- </Admonition>
- </StepHikeCompact.Details>
+![RedwoodJS Splash Page](/docs/img/redwoodjs-qs-splash.png)
- <StepHikeCompact.Code>
- ```bash name=Terminal
- yarn rw prisma db seed
- ```
- </StepHikeCompact.Code>
+## 11. View instruments UI
- </StepHikeCompact.Step>
+Click on `/instruments` to visit http://localhost:8910/instruments where should see the list of instruments.
- <StepHikeCompact.Step step={10}>
- <StepHikeCompact.Details title="Scaffold the Instrument UI">
- Now, we'll use RedwoodJS generators to scaffold a CRUD UI for the `Instrument` model.
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
- ```bash name=Terminal
- yarn rw g scaffold instrument
- ```
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={11}>
- <StepHikeCompact.Details title="Start the app">
- Start the app via `yarn rw dev`. A browser will open to the RedwoodJS Splash page.
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
- ![RedwoodJS Splash Page](/docs/img/redwoodjs-qs-splash.png)
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={12}>
- <StepHikeCompact.Details title="View Books UI">
- Click on `/instruments` to visit http://localhost:8910/instruments where should see the list of instruments.
-
- You may now edit, delete, and add new books using the scaffolded UI.
- </StepHikeCompact.Details>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+You may now edit, delete, and add new instruments using the scaffolded UI.
diff --git a/apps/docs/content/guides/getting-started/quickstarts/refine.mdx b/apps/docs/content/guides/getting-started/quickstarts/refine.mdx
index 1706c86e717..deee438d6c2 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/refine.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/refine.mdx
@@ -2,224 +2,148 @@
title: 'Use Supabase with Refine'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Refine app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Refine app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a [Refine](https://github.com/refinedev/refine) app using the [create refine-app](https://refine.dev/docs/getting-started/quickstart/).
- </StepHikeCompact.Step>
+The `refine-supabase` preset adds `@refinedev/supabase` supplementary package that supports Supabase in a Refine app. `@refinedev/supabase` out-of-the-box includes the Supabase dependency: [supabase-js](https://github.com/supabase/supabase-js).
- <StepHikeCompact.Step step={2}>
+```bash
+npm create refine-app@latest -- --preset refine-supabase my-app
+```
- <StepHikeCompact.Details title="Create a Refine app">
+![Refine welcome page](/docs/img/refine-qs-welcome-page.png)
- Create a [Refine](https://github.com/refinedev/refine) app using the [create refine-app](https://refine.dev/docs/getting-started/quickstart/).
+<$Partial path="api_settings.mdx" variables={{ "framework": "refine", "tab": "frameworks" }} />
- The `refine-supabase` preset adds `@refinedev/supabase` supplementary package that supports Supabase in a Refine app. `@refinedev/supabase` out-of-the-box includes the Supabase dependency: [supabase-js](https://github.com/supabase/supabase-js).
+## 4. Update `supabaseClient` with environment variables
- </StepHikeCompact.Details>
+Update the `supabaseClient` with the `SUPABASE_URL` and `SUPABASE_KEY` of your Supabase API, which you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=refine&tab=frameworks). The `supabaseClient` is used in auth provider and data provider methods that allow the Refine app to connect to your Supabase backend.
- <StepHikeCompact.Code>
+```ts name=src/utility/supabaseClient.ts
+import { createClient } from '@refinedev/supabase'
+
+const SUPABASE_URL = '<your-supabase-url>'
+const SUPABASE_KEY = '<your-supabase-publishable-key>'
+
+export const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY, {
+ db: {
+ schema: 'public',
+ },
+ auth: {
+ persistSession: true,
+ },
+})
+```
- ```bash name=Terminal
- npm create refine-app@latest -- --preset refine-supabase my-app
- ```
+## 5. Add instruments resource and pages
- </StepHikeCompact.Code>
+Use the following code to automatically add resources and generate code for the pages to show the `instruments` data using Refine Inferencer.
- </StepHikeCompact.Step>
+This defines pages for `list`, `create`, `show` and `edit` actions inside the `src/pages/instruments/` directory with a `<HeadlessInferencer />` component.
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Open your Refine app in VS Code">
+The `<HeadlessInferencer />` component depends on `@refinedev/react-table` and `@refinedev/react-hook-form` packages. To avoid errors, you should install them as dependencies with `npm install @refinedev/react-table @refinedev/react-hook-form`.
- You will develop your app, connect to the Supabase backend and run the Refine app in VS Code.
+<Admonition type="note">
- </StepHikeCompact.Details>
+The `<HeadlessInferencer />` is a Refine Inferencer component that automatically generates necessary code for the `list`, `create`, `show` and `edit` pages.
- <StepHikeCompact.Code>
+Read more on [how the Inferencer works is in the Refine docs](https://refine.dev/docs/packages/documentation/inferencer/).
- ```bash name=Terminal
- cd my-app
- code .
- ```
+</Admonition>
- </StepHikeCompact.Code>
+```bash
+npm run refine create-resource instruments
+```
- </StepHikeCompact.Step>
+## 6. Add routes for instruments pages
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Start the app">
+Add routes for the `list`, `create`, `show`, and `edit` pages.
- Start the app, go to http://localhost:5173 in a browser, and you should be greeted with the Refine Welcome page.
+<Admonition type="tip">
- </StepHikeCompact.Details>
+Remove the `index` route for the Welcome page presented with the `<Welcome />` component.
- <StepHikeCompact.Code>
+</Admonition>
- ```bash name=Terminal
- npm run dev
- ```
+```tsx name=src/App.tsx
+import { Refine } from '@refinedev/core'
+import { RefineKbar, RefineKbarProvider } from '@refinedev/kbar'
+import routerProvider, {
+ DocumentTitleHandler,
+ NavigateToResource,
+ UnsavedChangesNotifier,
+} from '@refinedev/react-router'
+import { dataProvider, liveProvider } from '@refinedev/supabase'
+import { BrowserRouter, Route, Routes } from 'react-router-dom'
-<StepHikeCompact.Code>
- ![Refine welcome page](/docs/img/refine-qs-welcome-page.png)
-</StepHikeCompact.Code>
+import './App.css'
- </StepHikeCompact.Code>
+import authProvider from './authProvider'
+import {
+ InstrumentsCreate,
+ InstrumentsEdit,
+ InstrumentsList,
+ InstrumentsShow,
+} from './pages/instruments'
+import { supabaseClient } from './utility'
- </StepHikeCompact.Step>
-
-<StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Update `supabaseClient`">
-
- You now have to update the `supabaseClient` with the `SUPABASE_URL` and `SUPABASE_KEY` of your Supabase API. The `supabaseClient` is used in auth provider and data provider methods that allow the Refine app to connect to your Supabase backend.
-
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
-
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```ts name=src/utility/supabaseClient.ts
- import { createClient } from "@refinedev/supabase";
-
- const SUPABASE_URL = YOUR_SUPABASE_URL;
- const SUPABASE_KEY = YOUR_SUPABASE_KEY
-
- export const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY, {
- db: {
- schema: "public",
- },
- auth: {
- persistSession: true,
- },
- });
- ```
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "refine", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Add instruments resource and pages">
-
- You have to then configure resources and define pages for `instruments` resource.
-
- Use the following command to automatically add resources and generate code for pages for `instruments` using Refine Inferencer.
-
- This defines pages for `list`, `create`, `show` and `edit` actions inside the `src/pages/instruments/` directory with `<HeadlessInferencer />` component.
-
- The `<HeadlessInferencer />` component depends on `@refinedev/react-table` and `@refinedev/react-hook-form` packages. In order to avoid errors, you should install them as dependencies with `npm install @refinedev/react-table @refinedev/react-hook-form`.
-
- <Admonition type="note">
-
- The `<HeadlessInferencer />` is a Refine Inferencer component that automatically generates necessary code for the `list`, `create`, `show` and `edit` pages.
-
- More on [how the Inferencer works is available in the docs here](https://refine.dev/docs/packages/documentation/inferencer/).
-
- </Admonition>
-
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run refine create-resource instruments
- ```
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Add routes for instruments pages">
-
- Add routes for the `list`, `create`, `show`, and `edit` pages.
-
- <Admonition type="tip">
-
- You should remove the `index` route for the Welcome page presented with the `<Welcome />` component.
-
- </Admonition>
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
- ```tsx name=src/App.tsx
- import { Refine } from "@refinedev/core";
- import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar";
- import routerProvider, {
- DocumentTitleHandler,
- NavigateToResource,
- UnsavedChangesNotifier,
- } from "@refinedev/react-router";
- import { dataProvider, liveProvider } from "@refinedev/supabase";
- import { BrowserRouter, Route, Routes } from "react-router-dom";
-
- import "./App.css";
- import authProvider from "./authProvider";
- import { supabaseClient } from "./utility";
- import { InstrumentsCreate, InstrumentsEdit, InstrumentsList, InstrumentsShow } from "./pages/instruments";
-
- function App() {
- return (
- <BrowserRouter>
- <RefineKbarProvider>
- <Refine
- dataProvider={dataProvider(supabaseClient)}
- liveProvider={liveProvider(supabaseClient)}
- authProvider={authProvider}
- routerProvider={routerProvider}
- options={{
- syncWithLocation: true,
- warnWhenUnsavedChanges: true,
- }}
- resources={[{
- name: "instruments",
- list: "/instruments",
- create: "/instruments/create",
- edit: "/instruments/edit/:id",
- show: "/instruments/show/:id"
- }]}>
- <Routes>
- <Route index
- element={<NavigateToResource resource="instruments" />}
- />
- <Route path="/instruments">
- <Route index element={<InstrumentsList />} />
- <Route path="create" element={<InstrumentsCreate />} />
- <Route path="edit/:id" element={<InstrumentsEdit />} />
- <Route path="show/:id" element={<InstrumentsShow />} />
- </Route>
- </Routes>
- <RefineKbar />
- <UnsavedChangesNotifier />
- <DocumentTitleHandler />
- </Refine>
- </RefineKbarProvider>
- </BrowserRouter>
- );
- }
-
- export default App;
- ```
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={8}>
- <StepHikeCompact.Details title="View instruments pages">
-
- Now you should be able to see the instruments pages along the `/instruments` routes. You may now edit and add new instruments using the Inferencer generated UI.
-
- The Inferencer auto-generated code gives you a good starting point on which to keep building your `list`, `create`, `show` and `edit` pages. They can be obtained by clicking the `Show the auto-generated code` buttons in their respective pages.
- </StepHikeCompact.Details>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+function App() {
+ return (
+ <BrowserRouter>
+ <RefineKbarProvider>
+ <Refine
+ dataProvider={dataProvider(supabaseClient)}
+ liveProvider={liveProvider(supabaseClient)}
+ authProvider={authProvider}
+ routerProvider={routerProvider}
+ options={{
+ syncWithLocation: true,
+ warnWhenUnsavedChanges: true,
+ }}
+ resources={[
+ {
+ name: 'instruments',
+ list: '/instruments',
+ create: '/instruments/create',
+ edit: '/instruments/edit/:id',
+ show: '/instruments/show/:id',
+ },
+ ]}
+ >
+ <Routes>
+ <Route index element={<NavigateToResource resource="instruments" />} />
+ <Route path="/instruments">
+ <Route index element={<InstrumentsList />} />
+ <Route path="create" element={<InstrumentsCreate />} />
+ <Route path="edit/:id" element={<InstrumentsEdit />} />
+ <Route path="show/:id" element={<InstrumentsShow />} />
+ </Route>
+ </Routes>
+ <RefineKbar />
+ <UnsavedChangesNotifier />
+ <DocumentTitleHandler />
+ </Refine>
+ </RefineKbarProvider>
+ </BrowserRouter>
+ )
+}
+
+export default App
+```
+
+## 7. View instruments pages
+
+Start the app with the following command:
+
+```bash
+npm run dev
+```
+
+Open http://localhost:5173/instruments in a browser, and you should be able to see the instruments pages along the `/instruments` routes. You can edit and add new instruments using the Inferencer generated UI.
+
+The Inferencer auto-generated code gives you a good starting point on which to keep building your `list`, `create`, `show` and `edit` pages. You can get these by clicking the `Show the auto-generated code` buttons in their respective pages.
diff --git a/apps/docs/content/guides/getting-started/quickstarts/ruby-on-rails.mdx b/apps/docs/content/guides/getting-started/quickstarts/ruby-on-rails.mdx
index bec7d960cfd..bbf867e3aad 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/ruby-on-rails.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/ruby-on-rails.mdx
@@ -2,116 +2,68 @@
title: 'Use Supabase with Ruby on Rails'
subtitle: 'Learn how to create a Rails project and connect it to your Supabase Postgres database.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+## 1. Create a Rails project
- <StepHikeCompact.Step step={1}>
- <StepHikeCompact.Details title="Create a Rails Project">
+With your Ruby and Rails versions up to date, run `rails new` on your terminal to scaffold a new project.
- Make sure your Ruby and Rails versions are up to date, then use `rails new` to scaffold a new Rails project. Use the `-d=postgresql` flag to set it up for Postgres.
+Use the `-d=postgresql` flag to set it up for Postgres.
- Go to the [Rails docs](https://guides.rubyonrails.org/getting_started.html) for more details.
+Check the [Rails docs](https://guides.rubyonrails.org/getting_started.html) for more details.
- </StepHikeCompact.Details>
+```bash
+rails new blog -d=postgresql
+```
- <StepHikeCompact.Code>
+## 2. Set up the Postgres connection details
- ```bash name=Terminal
- rails new blog -d=postgresql
- ```
+Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely.
- </StepHikeCompact.Code>
+When your project is up and running, navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&method=session).
- </StepHikeCompact.Step>
+Look for the Session Pooler connection string and copy the string. You will need to replace the Password with your saved database password. You can reset your database password in your [Database Settings](/dashboard/project/_/database/settings) if you do not have it.
- <StepHikeCompact.Step step={2}>
- <StepHikeCompact.Details title="Set up the Postgres connection details">
+<Admonition type="note">
- Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely.
+If you're in an [IPv6 environment](https://github.com/orgs/supabase/discussions/27034) or have the IPv4 Add-On, you can use the direct connection string instead of Supavisor in Session mode.
- When your project is up and running, navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&method=session).
+</Admonition>
- Look for the Session Pooler connection string and copy the string. You will need to replace the Password with your saved database password. You can reset your database password in your [Database Settings](/dashboard/project/_/database/settings) if you do not have it.
+```bash name=.env
+export DATABASE_URL=postgres://postgres.xxxx:[email protected]:5432/postgres
+```
- <Admonition type="note">
+## 3. Create and run a database migration
- If you're in an [IPv6 environment](https://github.com/orgs/supabase/discussions/27034) or have the IPv4 Add-On, you can use the direct connection string instead of Supavisor in Session mode.
+Rails includes Active Record as the ORM as well as database migration tooling which generates the SQL migration files for you.
- </Admonition>
+Create an example `Article` model and generate the migration files.
- </StepHikeCompact.Details>
+```bash
+bin/rails generate model Article title:string body:text
+bin/rails db:migrate
+```
- <StepHikeCompact.Code>
+## 4. Use the model to interact with the database
- ```bash name=Terminal
- export DATABASE_URL=postgres://postgres.xxxx:[email protected]:5432/postgres
- ```
+You can use the included Rails console to interact with the database. For example, you can create new entries or list all entries in a Model's table.
- </StepHikeCompact.Code>
+```bash
+bin/rails console
+```
- </StepHikeCompact.Step>
+```rb name=irb
+article = Article.new(title: "Hello Rails", body: "I am on Rails!")
+article.save # Saves the entry to the database
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Create and run a database migration">
+Article.all
+```
- Rails includes Active Record as the ORM as well as database migration tooling which generates the SQL migration files for you.
+## 5. Start the app
- Create an example `Article` model and generate the migration files.
+Run the development server. Go to http://127.0.0.1:3000 in a browser to see your application running.
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- bin/rails generate model Article title:string body:text
- bin/rails db:migrate
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Use the Model to interact with the database">
-
- You can use the included Rails console to interact with the database. For example, you can create new entries or list all entries in a Model's table.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- bin/rails console
- ```
-
- ```rb name=irb
- article = Article.new(title: "Hello Rails", body: "I am on Rails!")
- article.save # Saves the entry to the database
-
- Article.all
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server. Go to http://127.0.0.1:3000 in a browser to see your application running.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- bin/rails server
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
-</StepHikeCompact>
+```bash
+bin/rails server
+```
diff --git a/apps/docs/content/guides/getting-started/quickstarts/solidjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/solidjs.mdx
index 1d5d01fbda5..7b87a50307b 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/solidjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/solidjs.mdx
@@ -2,135 +2,80 @@
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
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a SolidJS app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a SolidJS app using the `degit` command.
- </StepHikeCompact.Step>
+```bash
+npx degit solidjs/templates/js my-app
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a SolidJS 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.
- Create a SolidJS app using the `degit` command.
+Navigate to the SolidJS app and install `supabase-js`.
- </StepHikeCompact.Details>
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- <StepHikeCompact.Code>
+<$Partial path="api_settings.mdx" variables={{ "framework": "solidjs", "tab": "frameworks" }} />
- ```bash name=Terminal
- npx degit solidjs/templates/js my-app
- ```
+## 5. Declare Supabase environment variables
- </StepHikeCompact.Code>
+Create a `.env.local` file and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=solidjs&tab=frameworks):
- </StepHikeCompact.Step>
+<$CodeTabs>
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+```text name=.env.local
+VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- 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.
+</$CodeTabs>
- Navigate to the SolidJS app and install `supabase-js`.
+## 6. Query data from the app
- </StepHikeCompact.Details>
+In `App.jsx`, create a Supabase client to fetch the instruments data.
- <StepHikeCompact.Code>
+Add a `getInstruments` function to fetch the data and display the query result to the page.
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+```jsx name=src/App.jsx
+import { createClient } from '@supabase/supabase-js'
+import { createResource, For } from 'solid-js'
- </StepHikeCompact.Code>
+const supabase = createClient(
+ import.meta.env.VITE_SUPABASE_URL,
+ import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
+)
- </StepHikeCompact.Step>
+async function getInstruments() {
+ const { data } = await supabase.from('instruments').select()
+ return data
+}
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+function App() {
+ const [instruments] = createResource(getInstruments)
- Create a `.env.local` file and populate with your Supabase connection variables:
+ return (
+ <ul>
+ <For each={instruments()}>{(instrument) => <li>{instrument.name}</li>}</For>
+ </ul>
+ )
+}
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+export default App
+```
+## 7. Start the app
- </StepHikeCompact.Details>
+Start the app and go to http://localhost:3000 in a browser and you should see the list of instruments.
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```text name=.env.local
- VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
-
- </$CodeTabs>
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "solidjs", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Query data from the app">
-
- 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.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
-
- ```jsx name=src/App.jsx
- import { createClient } from "@supabase/supabase-js";
- import { createResource, For } from "solid-js";
-
- const supabase = createClient('https://<project>.supabase.co', '<sb_publishable_key>');
-
- async function getInstruments() {
- const { data } = await supabase.from("instruments").select();
- return data;
- }
-
- function App() {
- const [instruments] = createResource(getInstruments);
-
- return (
- <ul>
- <For each={instruments()}>{(instrument) => <li>{instrument.name}</li>}</For>
- </ul>
- );
- }
-
- export default App;
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Start the app">
-
- Start the app and go to http://localhost:3000 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
diff --git a/apps/docs/content/guides/getting-started/quickstarts/sveltekit.mdx b/apps/docs/content/guides/getting-started/quickstarts/sveltekit.mdx
index 30be6126edc..6c5c08cc444 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/sveltekit.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/sveltekit.mdx
@@ -2,204 +2,131 @@
title: 'Use Supabase with SvelteKit'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a SvelteKit app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a SvelteKit app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a SvelteKit app using the `npm create` command.
- </StepHikeCompact.Step>
+```bash
+npx sv create my-app
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a SvelteKit 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 SvelteKit app.
- Create a SvelteKit app using the `npm create` command.
+Navigate to the SvelteKit app and install `supabase-js`.
- </StepHikeCompact.Details>
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- <StepHikeCompact.Code>
+<$Partial path="api_settings.mdx" variables={{ "framework": "sveltekit", "tab": "frameworks" }} />
- ```bash name=Terminal
- npx sv create my-app
- ```
+## 5. Declare Supabase environment variables
- </StepHikeCompact.Code>
+Create a `.env` file at the root of your project and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=sveltekit&tab=frameworks):
- </StepHikeCompact.Step>
+<$CodeTabs>
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+```text name=.env
+PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- 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 SvelteKit app.
+</$CodeTabs>
- Navigate to the SvelteKit app and install `supabase-js`.
+## 6. Create the Supabase client
- </StepHikeCompact.Details>
+Create a `src/lib` directory in your SvelteKit app, create a file called `supabaseClient.js` and add the following code to initialize the Supabase client:
- <StepHikeCompact.Code>
+<$CodeTabs>
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+```js name=src/lib/supabaseClient.js
+import { createClient } from '@supabase/supabase-js'
+import { PUBLIC_SUPABASE_PUBLISHABLE_KEY, PUBLIC_SUPABASE_URL } from '$env/static/public'
- </StepHikeCompact.Code>
+export const supabase = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY)
+```
- </StepHikeCompact.Step>
+```ts name=src/lib/supabaseClient.ts
+import { createClient } from '@supabase/supabase-js'
+import { PUBLIC_SUPABASE_PUBLISHABLE_KEY, PUBLIC_SUPABASE_URL } from '$env/static/public'
- <StepHikeCompact.Step step={4}>
+export const supabase = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY)
+```
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+</$CodeTabs>
- Create a `.env` file at the root of your project and populate with your Supabase connection variables:
+## 7. Query data from the app
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+Use `load` method to fetch the data server-side and display the query results as a list.
+Create `+page.server.js` file in the `src/routes` directory with the following code.
- </StepHikeCompact.Details>
+<$CodeTabs>
- <StepHikeCompact.Code>
+```js name=src/routes/+page.server.js
+import { supabase } from '$lib/supabaseClient'
- <$CodeTabs>
+export async function load() {
+ const { data } = await supabase.from('instruments').select()
+ return {
+ instruments: data ?? [],
+ }
+}
+```
- ```text name=.env
- PUBLIC_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- PUBLIC_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
+```ts name=src/routes/+page.server.ts
+import { supabase } from '$lib/supabaseClient'
- </$CodeTabs>
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "sveltekit", "tab": "frameworks" }} />
+import type { PageServerLoad } from './$types'
- </StepHikeCompact.Code>
+type Instrument = {
+ id: number
+ name: string
+}
- </StepHikeCompact.Step>
+export const load: PageServerLoad = async () => {
+ const { data, error } = await supabase.from('instruments').select<'instruments', Instrument>()
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Create the Supabase client">
+ if (error) {
+ console.error('Error loading instruments:', error.message)
+ return { instruments: [] }
+ }
- Create a `src/lib` directory in your SvelteKit app, create a file called `supabaseClient.js` and add the following code to initialize the Supabase client:
+ return {
+ instruments: data ?? [],
+ }
+}
+```
- </StepHikeCompact.Details>
+</$CodeTabs>
- <StepHikeCompact.Code>
+Replace the existing content in your `+page.svelte` file in the `src/routes` directory with the following code.
- <$CodeTabs>
+```svelte name=src/routes/+page.svelte
+<script>
+ let { data } = $props();
+</script>
- ```js name=src/lib/supabaseClient.js
- import { createClient } from '@supabase/supabase-js';
- import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY } from '$env/static/public';
+<ul>
+ {#each data.instruments as instrument}
+ <li>{instrument.name}</li>
+ {/each}
+</ul>
+```
- export const supabase = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY)
- ```
+## 8. Start the app
- ```ts name=src/lib/supabaseClient.ts
- import { createClient } from '@supabase/supabase-js';
- import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY } from '$env/static/public';
+Start the app and go to http://localhost:5173 in a browser and you should see the list of instruments.
- export const supabase = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY)
- ```
-
- </$CodeTabs>
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Use `load` method to fetch the data server-side and display the query results as a list.
-
- Create `+page.server.js` file in the `src/routes` directory with the following code.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
- <$CodeTabs>
-
- ```js name=src/routes/+page.server.js
- import { supabase } from "$lib/supabaseClient";
-
- export async function load() {
- const { data } = await supabase.from("instruments").select();
- return {
- instruments: data ?? [],
- };
- }
- ```
-
- ```ts name=src/routes/+page.server.ts
- import type { PageServerLoad } from './$types';
- import { supabase } from '$lib/supabaseClient';
-
- type Instrument = {
- id: number;
- name: string;
- };
-
- export const load: PageServerLoad = async () => {
- const { data, error } = await supabase.from('instruments').select<'instruments', Instrument>();
-
- if (error) {
- console.error('Error loading instruments:', error.message);
- return { instruments: [] };
- }
-
- return {
- instruments: data ?? [],
- };
- };
- ```
-
- </$CodeTabs>
-
- </StepHikeCompact.Code>
-
- <StepHikeCompact.Details title="">
-
- Replace the existing content in your `+page.svelte` file in the `src/routes` directory with the following code.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
-
- ```svelte name=src/routes/+page.svelte
- <script>
- let { data } = $props();
- </script>
-
- <ul>
- {#each data.instruments as instrument}
- <li>{instrument.name}</li>
- {/each}
- </ul>
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Start the app">
-
- Start the app and go to http://localhost:5173 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/tanstack.mdx b/apps/docs/content/guides/getting-started/quickstarts/tanstack.mdx
index 569ac3591ae..cd9dc019fa6 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/tanstack.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/tanstack.mdx
@@ -2,160 +2,95 @@
title: 'Use Supabase with TanStack Start'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a TanStack Start app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a TanStack Start app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a TanStack Start app using the official CLI.
- </StepHikeCompact.Step>
+```bash
+npm create @tanstack/start@latest my-app -- --package-manager npm --toolchain biome
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a TanStack Start 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 TanStack Start app.
- - Create a TanStack Start app using the official CLI.
+Navigate to the TanStack Start app and install `supabase-js`.
- <$Partial path="uiLibCta.mdx" />
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "" }} />
- <StepHikeCompact.Code>
+## 5. Declare Supabase environment variables
- ```bash name=Terminal
- npm create @tanstack/start@latest my-app -- --package-manager npm --toolchain biome
- ```
+Create a `.env` file in the root of your project and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true):
- </StepHikeCompact.Code>
+<$CodeTabs>
- </StepHikeCompact.Step>
+```text name=.env
+VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+</$CodeTabs>
- 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 TanStack Start app.
+## 6. Create a Supabase client utility
- Navigate to the TanStack Start app and install `supabase-js`.
+Create a new file at `src/utils/supabase.ts` to initialize the Supabase client.
- </StepHikeCompact.Details>
+```ts name=src/utils/supabase.ts
+import { createClient } from '@supabase/supabase-js'
- <StepHikeCompact.Code>
+export const supabase = createClient(
+ import.meta.env.VITE_SUPABASE_URL,
+ import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
+)
+```
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+## 7. Query data from the app
- </StepHikeCompact.Code>
+<$Partial path="uiLibCta.mdx" />
- </StepHikeCompact.Step>
+Replace the contents of `src/routes/index.tsx` with the following code to add a loader function that fetches the instruments data and displays it on the page.
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+```tsx name=src/routes/index.tsx
+import { createFileRoute } from '@tanstack/react-router'
- Create a `.env` file in the root of your project and populate with your Supabase connection variables:
+import { supabase } from '../utils/supabase'
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+export const Route = createFileRoute('/')({
+ loader: async () => {
+ const { data: instruments } = await supabase.from('instruments').select()
+ return { instruments }
+ },
+ component: Home,
+})
+function Home() {
+ const { instruments } = Route.useLoaderData()
- </StepHikeCompact.Details>
+ return (
+ <ul>
+ {instruments?.map((instrument) => (
+ <li key={instrument.name}>{instrument.name}</li>
+ ))}
+ </ul>
+ )
+}
+```
- <StepHikeCompact.Code>
+## 8. Start the app
- <$CodeTabs>
+Run the development server, go to http://localhost:3000 in a browser and you should see the list of instruments.
- ```text name=.env
- VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
-
- </$CodeTabs>
-
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "", "tab": "" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Create a Supabase client utility">
-
- Create a new file at `src/utils/supabase.ts` to initialize the Supabase client.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```ts name=src/utils/supabase.ts
- import { createClient } from "@supabase/supabase-js";
-
- export const supabase = createClient(
- import.meta.env.VITE_SUPABASE_URL,
- import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
- );
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Replace the contents of `src/routes/index.tsx` with the following code to add a loader function that fetches the instruments data and displays it on the page.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
- ```tsx name=src/routes/index.tsx
- import { createFileRoute } from '@tanstack/react-router'
- import { supabase } from '../utils/supabase'
-
- export const Route = createFileRoute('/')({
- loader: async () => {
- const { data: instruments } = await supabase.from('instruments').select()
- return { instruments }
- },
- component: Home,
- })
-
- function Home() {
- const { instruments } = Route.useLoaderData()
-
- return (
- <ul>
- {instruments?.map((instrument) => (
- <li key={instrument.name}>{instrument.name}</li>
- ))}
- </ul>
- )
- }
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Start the app">
-
- Run the development server, go to http://localhost:3000 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
## Next steps
diff --git a/apps/docs/content/guides/getting-started/quickstarts/vue.mdx b/apps/docs/content/guides/getting-started/quickstarts/vue.mdx
index 269233acf16..30ea51f9a01 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/vue.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/vue.mdx
@@ -2,156 +2,89 @@
title: 'Use Supabase with Vue'
subtitle: 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Vue app.'
breadcrumb: 'Framework Quickstarts'
-hideToc: true
---
-<StepHikeCompact>
+<$Partial path="quickstart_db_setup.mdx" />
- <StepHikeCompact.Step step={1}>
+## 3. Create a Vue app
- <$Partial path="quickstart_db_setup.mdx" />
+Create a Vue app using the `npm init` command.
- </StepHikeCompact.Step>
+```sh
+npm init vue@latest my-app
+```
- <StepHikeCompact.Step step={2}>
+## 4. Install the Supabase client library
- <StepHikeCompact.Details title="Create a Vue 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 Vue app.
- - Create a Vue app using the `npm init` command.
+Navigate to the Vue app and install `supabase-js`.
- <$Partial path="uiLibCta.mdx" />
+```bash
+cd my-app && npm install @supabase/supabase-js
+```
- </StepHikeCompact.Details>
+<$Partial path="api_settings.mdx" variables={{ "framework": "vue", "tab": "frameworks" }} />
- <StepHikeCompact.Code>
+## 5. Declare Supabase environment variables
- ```sh name=Terminal
- npm init vue@latest my-app
- ```
+Create a `.env.local` file and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=vue&tab=frameworks):
- </StepHikeCompact.Code>
+<$CodeTabs>
- </StepHikeCompact.Step>
+```text name=.env.local
+VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
+VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
+```
- <StepHikeCompact.Step step={3}>
- <StepHikeCompact.Details title="Install the Supabase client library">
+</$CodeTabs>
- 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 Vue app.
+## 6. Create the Supabase client
- Navigate to the Vue app and install `supabase-js`.
+Create a `/src/lib` directory in your Vue app, create a file called `supabaseClient.js` and add the following code to initialize the Supabase client:
- </StepHikeCompact.Details>
+```js name=src/lib/supabaseClient.js
+import { createClient } from '@supabase/supabase-js'
- <StepHikeCompact.Code>
+const supabaseUrl = import.meta.env.VITE_SUPABASE_URL
+const supabasePublishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
- ```bash name=Terminal
- cd my-app && npm install @supabase/supabase-js
- ```
+export const supabase = createClient(supabaseUrl, supabasePublishableKey)
+```
- </StepHikeCompact.Code>
+## 7. Query data from the app
- </StepHikeCompact.Step>
+Replace the existing content in your `App.vue` file with the following code.
- <StepHikeCompact.Step step={4}>
- <StepHikeCompact.Details title="Declare Supabase Environment Variables">
+```vue name=src/App.vue
+<script setup>
+import { onMounted, ref } from 'vue'
- Create a `.env.local` file and populate with your Supabase connection variables:
+import { supabase } from './lib/supabaseClient'
- <ProjectConfigVariables variable="url" />
- <ProjectConfigVariables variable="publishable" />
+const instruments = ref([])
+async function getInstruments() {
+ const { data } = await supabase.from('instruments').select()
+ instruments.value = data
+}
- </StepHikeCompact.Details>
+onMounted(() => {
+ getInstruments()
+})
+</script>
- <StepHikeCompact.Code>
+<template>
+ <ul>
+ <li v-for="instrument in instruments" :key="instrument.id">{{ instrument.name }}</li>
+ </ul>
+</template>
+```
- <$CodeTabs>
+## 8. Start the app
- ```text name=.env.local
- VITE_SUPABASE_URL=<SUBSTITUTE_SUPABASE_URL>
- VITE_SUPABASE_PUBLISHABLE_KEY=<SUBSTITUTE_SUPABASE_PUBLISHABLE_KEY>
- ```
+Start the app and go to http://localhost:5173 in a browser and you should see the list of instruments.
- </$CodeTabs>
- <$Partial path="api_settings_steps.mdx" variables={{ "framework": "vue", "tab": "frameworks" }} />
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={5}>
- <StepHikeCompact.Details title="Create the Supabase client">
-
- Create a `/src/lib` directory in your Vue app, create a file called `supabaseClient.js` and add the following code to initialize the Supabase client:
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```js name=src/lib/supabaseClient.js
- import { createClient } from '@supabase/supabase-js'
-
- const supabaseUrl = import.meta.env.VITE_SUPABASE_URL
- const supabasePublishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
-
- export const supabase = createClient(supabaseUrl, supabasePublishableKey)
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={6}>
- <StepHikeCompact.Details title="Query data from the app">
-
- Replace the existing content in your `App.vue` file with the following code.
-
- </StepHikeCompact.Details>
- <StepHikeCompact.Code>
-
-
- ```vue name=src/App.vue
- <script setup>
- import { ref, onMounted } from 'vue'
- import { supabase } from './lib/supabaseClient'
-
- const instruments = ref([])
-
- async function getInstruments() {
- const { data } = await supabase.from('instruments').select()
- instruments.value = data
- }
-
- onMounted(() => {
- getInstruments()
- })
- </script>
-
- <template>
- <ul>
- <li v-for="instrument in instruments" :key="instrument.id">{{ instrument.name }}</li>
- </ul>
- </template>
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-
- <StepHikeCompact.Step step={7}>
- <StepHikeCompact.Details title="Start the app">
-
- Start the app and go to http://localhost:5173 in a browser and you should see the list of instruments.
-
- </StepHikeCompact.Details>
-
- <StepHikeCompact.Code>
-
- ```bash name=Terminal
- npm run dev
- ```
-
- </StepHikeCompact.Code>
-
- </StepHikeCompact.Step>
-</StepHikeCompact>
+```bash
+npm run dev
+```
diff --git a/supa-mdx-lint/Rule001HeadingCase.toml b/supa-mdx-lint/Rule001HeadingCase.toml
index 26c6a97f1a2..b534cf3583f 100644
--- a/supa-mdx-lint/Rule001HeadingCase.toml
+++ b/supa-mdx-lint/Rule001HeadingCase.toml
@@ -15,6 +15,7 @@ may_uppercase = [
"Apache Spark",
"Apple",
"Assistant",
+ "Astro",
"Audit Log Drains?",
"Audit Logs?",
"Auth",
@@ -86,6 +87,7 @@ may_uppercase = [
"Firebase",
"Firebase Authentication",
"Firestore",
+ "Flask",
"Flutter",
"Functions?",
"Free Plan",
@@ -129,6 +131,7 @@ may_uppercase = [
"Kotlin",
"Kotlin Multiplatform",
"Kysely",
+ "Laravel",
"Large Language Models?",
"LinkedIn",
"LinkedIn Developers?",
@@ -151,6 +154,7 @@ may_uppercase = [
"Navigable Small World",
"Neon",
"Next.js",
+ "Node",
"Node.js",
"Notion",
"Nuxt",
@@ -186,6 +190,7 @@ may_uppercase = [
"Queues?",
"Quotas",
"Query Performance",
+ "Rails",
"React",
"Rollup",
"React Email",
@@ -230,6 +235,7 @@ may_uppercase = [
"Swift",
"SwiftUI",
"Solana",
+ "TanStack Start",
"Team Plan",
"Telegram",
"Third-Party Auth",
diff --git a/supa-mdx-lint/Rule003Spelling.toml b/supa-mdx-lint/Rule003Spelling.toml
index afa263dd7c6..f40cae78c20 100644
--- a/supa-mdx-lint/Rule003Spelling.toml
+++ b/supa-mdx-lint/Rule003Spelling.toml
@@ -348,6 +348,7 @@ allow_list = [
# We prefer Postgres, but check for vocabulary preference in a separate rule
"PostgreSQL",
"PowerBI",
+ "[Pp]refill",
"ProGuard",
"PubSub",
"Prisma",