Skip to content

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

Update nav for api

Joshen Lim748365a43c7f
diff --git a/apps/temp-docs/components/Navigation/Navigation.constants.ts b/apps/temp-docs/components/Navigation/Navigation.constants.ts
index ffebe26aa23..ec3873a7cc6 100644
--- a/apps/temp-docs/components/Navigation/Navigation.constants.ts
+++ b/apps/temp-docs/components/Navigation/Navigation.constants.ts
@@ -147,13 +147,6 @@ export const menuItems: NavMenu = {
},
],
},
- {
- label: 'APIs',
- items: [
- { name: 'Overview', url: '/guides/api', items: [] },
- { name: 'Generating Types', url: '/guides/api/generating-types', items: [] },
- ],
- },
{
label: 'Database',
items: [
diff --git a/apps/temp-docs/docs/guides/api.mdx b/apps/temp-docs/docs/guides/api.mdx
index 9aeafc23aa0..fc10871a9e2 100644
--- a/apps/temp-docs/docs/guides/api.mdx
+++ b/apps/temp-docs/docs/guides/api.mdx
@@ -7,7 +7,6 @@ sidebar_label: Overview
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
-import useBaseUrl from '@docusaurus/useBaseUrl'
Supabase auto-generates three types of API directly from your database schema.
@@ -87,12 +86,7 @@ This creates a corresponding route `todos` which can accept `GET`, `POST`, `PATC
1. Click **Save**.
<video width="99%" muted playsInline controls="true">
- <source
- src={useBaseUrl('/videos/api/api-create-table-sm.mp4')}
- type="video/mp4"
- muted
- playsInline
- />
+ <source src={'/docs/videos/api/api-create-table-sm.mp4'} type="video/mp4" muted playsInline />
</video>
</TabItem>
@@ -119,12 +113,7 @@ Every Supabase project has a unique API URL. Your API is secured behind an API g
3. Find your API `URL`, `anon`, and `service_role` keys on this page.
<video width="99%" muted playsInline controls="true">
- <source
- src={useBaseUrl('/videos/api/api-url-and-key.mp4')}
- type="video/mp4"
- muted
- playsInline
- />
+ <source src={'/docs/videos/api/api-url-and-key.mp4'} type="video/mp4" muted playsInline />
</video>
The REST API and the GraphQL API are both accessible through this URL:
@@ -153,12 +142,7 @@ Let's view the documentation for a `countries` table which we created in our dat
3. Switch between the JavaScript and the cURL docs using the tabs.
<video width="99%" muted playsInline controls="true">
- <source
- src={useBaseUrl('/videos/api/api-docs.mp4')}
- type="video/mp4"
- muted
- playsInline
- />
+ <source src={'/docs/videos/api/api-docs.mp4'} type="video/mp4" muted playsInline />
</video>
#### GraphQL
@@ -315,12 +299,7 @@ By default Realtime is disabled on your database. Let's turn on Realtime for the
4. Control which tables broadcast changes by selecting **Source** and toggling each table.
<video width="99%" muted playsInline controls="true">
- <source
- src={useBaseUrl('/videos/api/api-realtime.mp4')}
- type="video/mp4"
- muted
- playsInline
- />
+ <source src={'/docs/videos/api/api-realtime.mp4'} type="video/mp4" muted playsInline />
</video>
</TabItem>
@@ -346,10 +325,7 @@ const handleInserts = (payload) => {
}
// Listen to inserts
-const { data: todos, error } = await supabase
- .from('todos')
- .on('INSERT', handleInserts)
- .subscribe()
+const { data: todos, error } = await supabase.from('todos').on('INSERT', handleInserts).subscribe()
```
Use [subscribe()](/docs/reference/javascript/subscribe) to listen to database changes.