Skip to content

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

Adding some thoughts on how the client should be structured

Paul Copplestone949d93b08491
diff --git a/packages/web/content/docs/restful/introduction.mdx b/packages/web/content/docs/restful/introduction.mdx
index 735b693459f..a8bb4c87675 100644
--- a/packages/web/content/docs/restful/introduction.mdx
+++ b/packages/web/content/docs/restful/introduction.mdx
@@ -6,4 +6,48 @@ export const metadata = {
### Coming soon
-We're busy making Realtime awesome right now, and we'll get around to this as soon as we can.
\ No newline at end of file
+We're busy making Realtime awesome right now, and we'll get around to this as soon as we can.
+
+### Draft
+
+
+
+```js
+
+import { createClient } from '@supabase/supabase-js'
+
+const base = createClient(process.env.SUPABASE_URL)
+
+base.get('/users')
+base.post('/users')
+base.patch('/users')
+base.delete('/users')
+base.options('/users')
+
+
+const userId = 1
+const user = await base.get('/users').match({id: userId})
+const userTodos = await base.get('/todos').match().eq('user_id', userId)
+
+const toods = await api
+ .get('/todos')
+ .select(`
+ title,
+ details,
+ users {
+ name,
+ email
+ }
+ `)
+ .order('start_time')
+ .range(0, 5)
+
+
+const userListener1 = base.subscribe('users').on('*', () => {})
+const userListener2 = base.subscribe('users').on('INSERT', () => {})
+const userListener3 = base.subscribe('users').on('INSERT', () => {})
+const userListener4 = base.subscribe('users').on('DELETE', () => {})
+
+userListener1.unsubscribe()
+
+```
\ No newline at end of file