Skip to content

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

add overview page in auth & auth admin sections

Kang Ming27ff15ba9248
diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json
index 1e40d5cfab7..bbe1a567df5 100644
--- a/spec/common-client-libs-sections.json
+++ b/spec/common-client-libs-sections.json
@@ -388,6 +388,13 @@
"title": "Auth",
"libs": ["js", "js_v1", "dart", "dart_v0"],
"items": [
+ {
+ "id": "auth-api",
+ "title": "Overview",
+ "slug": "auth-api",
+ "libs": ["js"],
+ "type": "function"
+ },
{
"id": "sign-up",
"title": "Create a new user",
@@ -616,12 +623,12 @@
]
},
{
- "title": "Auth (server-only)",
+ "title": "Auth Admin",
"libs": ["js", "js_v1"],
"items": [
{
"id": "admin-api",
- "title": "Auth (server-only)",
+ "title": "Overview",
"slug": "admin-api",
"libs": ["js", "js_v1"],
"type": "function"
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index 389d39094ae..5860a40b6da 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -103,6 +103,35 @@ functions:
```
For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth.
+ - id: auth-api
+ title: 'Overview'
+ notes: |
+ - The auth methods can be accessed via the `supabase.auth` namespace.
+ examples:
+ - id: create-auth-client
+ name: Create auth client
+ isSpotlight: true
+ code: |
+ ```js
+ import { createClient } from '@supabase/supabase-js'
+
+ const supabase = createClient(supabase_url, anon_key)
+ ```
+ - id: create-auth-client-server-side
+ name: Create auth client (server-side)
+ isSpotlight: false
+ code: |
+ ```js
+ import { createClient } from '@supabase/supabase-js'
+
+ const supabase = createClient(supabase_url, anon_key, {
+ auth: {
+ autoRefreshToken: false,
+ persistSession: false,
+ detectSessionInUrl: false
+ }
+ })
+ ```
- id: sign-up
title: 'signUp()'
$ref: '@supabase/gotrue-js.GoTrueClient.signUp'
@@ -565,6 +594,24 @@ functions:
notes: |
- Any method under the `supabase.auth.admin` namespace requires a `service_role` key.
- These methods are considered admin methods and should be called on a trusted server. Never expose your `service_role` key in the browser.
+ examples:
+ - id: create-auth-admin-client
+ name: Create server-side auth client
+ isSpotlight: true
+ code: |
+ ```js
+ import { createClient } from '@supabase/supabase-js'
+
+ const supabase = createClient(supabase_url, service_role_key, {
+ auth: {
+ autoRefreshToken: false,
+ persistSession: false
+ }
+ })
+
+ // Access auth admin api
+ const adminAuthClient = supabase.auth.admin
+ ```
- id: get-user-by-id
title: 'getUserById()'