diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml
index bacadccbf1e..0a4d1b1fd57 100644
--- a/.github/workflows/mirror.yml
+++ b/.github/workflows/mirror.yml
@@ -1,10 +1,15 @@
name: Mirror Image
on:
+ workflow_call:
+ inputs:
+ version:
+ required: true
+ type: string
workflow_dispatch:
inputs:
version:
- description: "Image tag"
+ description: 'Image tag'
required: true
type: string
diff --git a/.github/workflows/publish_image.yml b/.github/workflows/publish_image.yml
index fb21fd49d43..f57fd2515d3 100644
--- a/.github/workflows/publish_image.yml
+++ b/.github/workflows/publish_image.yml
@@ -14,29 +14,39 @@ on:
type: string
jobs:
- publish:
+ settings:
runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
+ outputs:
+ image_version: ${{ steps.meta.outputs.version }}
steps:
- id: meta
uses: docker/metadata-action@v4
with:
images: |
supabase/studio
- public.ecr.aws/supabase/studio
- ghcr.io/supabase/studio
flavor: |
latest=false
tags: |
type=ref,event=tag
- type=sha,prefix={{date 'YYYYMMDD'}},enable=${{ github.ref_type == 'branch' }}
- type=raw,value=${{ inputs.version }},enable=${{ github.event_name != 'push' }}
+ type=sha,prefix={{date 'YYYYMMDD'}}-,enable=${{ github.event_name == 'push' && github.ref_type == 'branch' }}
+ type=raw,value=${{ inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
- - uses: docker/setup-qemu-action@v2
+ release_x86:
+ needs: settings
+ runs-on: ubuntu-latest
+ timeout-minutes: 120
+ env:
+ arch: amd64
+ outputs:
+ image_digest: ${{ steps.build.outputs.digest }}
+ steps:
+ - id: meta
+ uses: docker/metadata-action@v4
with:
- platforms: amd64,arm64
+ images: |
+ supabase/studio
+ tags: |
+ type=raw,value=${{ needs.settings.outputs.image_version }}_${{ env.arch }}
- uses: docker/setup-buildx-action@v2
@@ -46,27 +56,86 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Login to ECR
- uses: docker/login-action@v2
- with:
- registry: public.ecr.aws
- username: ${{ secrets.PROD_ACCESS_KEY_ID }}
- password: ${{ secrets.PROD_SECRET_ACCESS_KEY }}
-
- - name: Login to GHCR
- uses: docker/login-action@v2
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - uses: docker/build-push-action@v3
+ - id: build
+ uses: docker/build-push-action@v3
with:
push: true
context: '{{defaultContext}}'
file: studio/Dockerfile
target: production
- platforms: linux/amd64,linux/arm64
+ platforms: linux/${{ env.arch }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
+
+ release_arm:
+ needs: settings
+ runs-on: arm-runner
+ timeout-minutes: 120
+ env:
+ arch: arm64
+ outputs:
+ image_digest: ${{ steps.build.outputs.digest }}
+ steps:
+ - uses: actions/checkout@v3
+
+ - id: meta
+ uses: docker/metadata-action@v4
+ with:
+ images: |
+ supabase/studio
+ tags: |
+ type=raw,value=${{ needs.settings.outputs.image_version }}_${{ env.arch }}
+
+ - uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - uses: docker/setup-buildx-action@v2
+ with:
+ driver: docker
+ driver-opts: |
+ image=moby/buildkit:master
+ network=host
+
+ - id: build
+ uses: docker/build-push-action@v3
+ with:
+ push: true
+ context: .
+ file: studio/Dockerfile
+ target: production
+ platforms: linux/${{ env.arch }}
+ tags: ${{ steps.meta.outputs.tags }}
+ no-cache: true
+
+ merge_manifest:
+ needs:
+ - settings
+ - release_x86
+ - release_arm
+ runs-on: ubuntu-latest
+ steps:
+ - uses: docker/setup-buildx-action@v2
+
+ - uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Merge multi-arch manifests
+ run: |
+ docker buildx imagetools create -t supabase/studio:${{ needs.settings.outputs.image_version }} \
+ supabase/studio@${{ needs.release_x86.outputs.image_digest }} \
+ supabase/studio@${{ needs.release_arm.outputs.image_digest }}
+
+ publish:
+ needs:
+ - settings
+ - merge_manifest
+ # Call workflow explicitly because events from actions cannot trigger more actions
+ uses: ./.github/workflows/mirror.yml
+ with:
+ version: ${{ needs.settings.outputs.image_version }}
+ secrets: inherit
diff --git a/apps/docs/components/Navigation/Navigation.constants.ts b/apps/docs/components/Navigation/Navigation.constants.ts
index a9750d6037c..53b76960443 100644
--- a/apps/docs/components/Navigation/Navigation.constants.ts
+++ b/apps/docs/components/Navigation/Navigation.constants.ts
@@ -102,6 +102,7 @@ export const menuItems: NavMenu = {
{ name: 'Login with Twitch', url: '/guides/auth/auth-twitch', items: [] },
{ name: 'Login with Twitter', url: '/guides/auth/auth-twitter', items: [] },
{ name: 'Login with WorkOS', url: '/guides/auth/auth-workos', items: [] },
+ { name: 'Login with Zoom', url: '/guides/auth/auth-zoom', items: [] },
{ name: 'Phone Auth with Twilio', url: '/guides/auth/auth-twilio', items: [] },
{ name: 'Phone Auth with Vonage', url: '/guides/auth/auth-vonage', items: [] },
{
@@ -265,6 +266,7 @@ export const menuItems: NavMenu = {
url: '/guides/platform/migrating-and-upgrading-projects',
items: [],
},
+ { name: 'Network Restrictions', url: '/guides/platform/network-restrictions', items: [] },
{ name: 'Performance Tuning', url: '/guides/platform/performance', items: [] },
{ name: 'Permissions', url: '/guides/platform/permissions', items: [] },
{ name: 'Production Readiness', url: '/guides/platform/going-into-prod', items: [] },
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index dc627058192..f39acf544da 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -240,6 +240,12 @@ export const SocialLoginItems = [
url: '/guides/auth/social-login/auth-workos',
items: [],
},
+ {
+ name: 'Zoom',
+ icon: '/docs/img/icons/zoom-icon',
+ url: '/guides/auth/social-login/auth-zoom',
+ items: [],
+ },
]
export const PhoneLoginsItems = [
@@ -475,6 +481,7 @@ export const platform = {
name: 'Platform Management',
url: undefined,
items: [
+ { name: 'Access Control', url: '/guides/platform/access-control', items: [] },
{ name: 'Database Usage', url: '/guides/platform/database-usage', items: [] },
{ name: 'Logging', url: '/guides/platform/logs', items: [] },
{ name: 'Metrics', url: '/guides/platform/metrics', items: [] },
@@ -483,10 +490,29 @@ export const platform = {
url: '/guides/platform/migrating-and-upgrading-projects',
items: [],
},
+ { name: 'Network Restrictions', url: '/guides/platform/network-restrictions', items: [] },
{ name: 'Performance Tuning', url: '/guides/platform/performance', items: [] },
{ name: 'Permissions', url: '/guides/platform/permissions', items: [] },
],
},
+ {
+ name: 'Single sign-on',
+ url: undefined,
+ items: [
+ {
+ name: 'Enable SSO for your organization',
+ url: '/guides/platform/sso',
+ items: [],
+ },
+ { name: 'SSO with Azure AD', url: '/guides/platform/sso/azure', items: [] },
+ {
+ name: 'SSO with Google Workspace',
+ url: '/guides/platform/sso/gsuite',
+ items: [],
+ },
+ { name: 'SSO with Okta', url: '/guides/platform/sso/okta', items: [] },
+ ],
+ },
{
name: 'Go-live Checklist',
url: undefined,
@@ -500,7 +526,8 @@ export const resources = {
label: 'Resources',
url: '/guides/resources',
items: [
- { name: 'Examples', url: '/guides/resources/examples', items: [] },
+ // removing until the examples page is reworked
+ // { name: 'Examples', url: '/guides/resources/examples', items: [] },
{ name: 'Glossary', url: '/guides/resources/glossary', items: [] },
{
name: 'Migrate to Supabase',
@@ -512,8 +539,8 @@ export const resources = {
items: [],
},
{
- name: 'Firebase Data',
- url: '/guides/resources/migrating-to-supabase/firebase-data',
+ name: 'Firestore Data',
+ url: '/guides/resources/migrating-to-supabase/firestore-data',
items: [],
},
{
@@ -543,7 +570,7 @@ export const resources = {
},
{
name: 'Managing Environments',
- url: '/guides/cli/managing-environments',
+ url: '/guides/resources/supabase-cli/managing-environments',
items: [],
},
],
diff --git a/apps/docs/pages/architecture.mdx b/apps/docs/pages/architecture.mdx
deleted file mode 100644
index 91048898791..00000000000
--- a/apps/docs/pages/architecture.mdx
+++ /dev/null
@@ -1,162 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'architecture',
- title: 'Architecture',
- description: 'Supabase design and architecture',
-}
-
-Supabase is open source. We choose open source tools which are scalable and make them simple to use.
-
-Supabase is not a 1-to-1 mapping of Firebase. While we are building many of the features that Firebase offers, we are not going about it the same way:
-our technological choices are quite different; everything we use is open source; and wherever possible, we use and support existing tools rather than developing from scratch.
-
-Most notably, we use Postgres rather than a NoSQL store. This choice was deliberate. We believe that no other database offers the functionality required to compete with Firebase,
-while maintaining the scalability required to go beyond it.
-
-## Architecture
-
-Each Supabase project consists of several tools:
-
-
-
-### PostgreSQL (Database)
-
-PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database — you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase.
-
-- Official Docs: [postgresql.org/docs](https://www.postgresql.org/docs/current/index.html)
-- Source code: [github.com/postgres/postgres](https://github.com/postgres/postgres) (mirror)
-- License: [PostgreSQL Licence](https://www.postgresql.org/about/licence/)
-- Language: C
-
-### Studio (Dashboard)
-
-An open source Dashboard for managing your database and services.
-
-- Official Docs: [Supabase docs](/docs)
-- Source code: [github.com/supabase/supabase](https://github.com/supabase/supabase/tree/master/studio)
-- License: [Apache 2](https://github.com/supabase/supabase/blob/master/LICENSE)
-- Language: TypeScript
-
-### GoTrue (Auth)
-
-A JWT-based API for managing users and issuing access tokens. This integrates with PostgreSQL's Row Level Security and the API servers.
-
-- Official Docs: [Supabase Auth reference docs](/docs/reference/auth)
-- Source code: [github.com/supabase/gotrue](https://github.com/supabase/gotrue)
-- License: [MIT](https://github.com/supabase/gotrue/blob/master/LICENSE)
-- Language: Go
-
-### PostgREST (API)
-
-A standalone web server that turns your PostgreSQL database directly into a RESTful API.
-We use this with our [pg_graphql](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API.
-
-- Official Docs: [postgrest.org](https://postgrest.org/)
-- Source code: [github.com/PostgREST/postgrest](https://github.com/PostgREST/postgrest)
-- License: [MIT](https://github.com/PostgREST/postgrest/blob/main/LICENSE)
-- Language: Haskel
-
-### Realtime (API & multiplayer)
-
-A scalable websocket engine for managing user Presence, broadcasting messages, and streaming database changes.
-
-- Official Docs: [Supabase Realtime docs](/docs/guides/realtime)
-- Source code: [github.com/supabase/realtime](https://github.com/supabase/realtime)
-- License: [Apache 2](https://github.com/supabase/realtime/blob/master/LICENSE)
-- Language: Elixir
-
-### Storage API (large file storage)
-
-An S3-compatible object storage service that stores metadata in Postgres.
-
-- Official Docs: [Supabase Storage reference docs](/docs/reference/storage)
-- Source code: [github.com/supabase/storage-api](https://github.com/supabase/storage-api)
-- License: [Apache 2.0](https://github.com/supabase/storage-api/blob/master/LICENSE)
-- Language: NodeJS / TypeScript
-
-### Deno (Edge Functions)
-
-A modern runtime for JavaScript and TypeScript.
-
-- Official Docs: [deno.land](https://deno.land/)
-- Source code: [github.com/denoland/deno](https://github.com/denoland/deno)
-- License: [MIT](https://github.com/denoland/deno/blob/main/LICENSE.md)
-- Language: TypeScript / Rust
-
-### postgres-meta (Database management)
-
-A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries.
-
-- Official Docs: [supabase.github.io/postgres-meta](https://supabase.github.io/postgres-meta/)
-- Source code: [github.com/supabase/postgres-meta](https://github.com/supabase/postgres-meta)
-- License: [Apache 2.0](https://github.com/supabase/postgres-meta/blob/master/LICENSE)
-- Language: NodeJS / TypeScript
-
-### PgBouncer
-
-A lightweight connection pooler for PostgreSQL. This is useful for connecting to Postgres when using Serverless functions.
-
-- Official Docs: [pgbouncer.org](http://www.pgbouncer.org/)
-- Source code: [pgbouncer/pgbouncer](https://github.com/pgbouncer/pgbouncer)
-- License: [ISC](https://github.com/pgbouncer/pgbouncer/blob/master/COPYRIGHT)
-- Language: C
-
-### Kong (API Gateway)
-
-A cloud-native API gateway, built on top of Nginx.
-
-- Official Docs: [docs.konghq.com](https://docs.konghq.com/)
-- Source code: [github.com/kong/kong](https://github.com/kong/kong)
-- License: [Apache 2.0](https://github.com/Kong/kong/blob/master/LICENSE)
-- Language: Lua
-
-## Product Principles
-
-It is our goal to provide an architecture that any large-scale company would design for themselves,
-and then provide tooling around that architecture that is easy-to-use for indie-developers and small teams.
-
-We use a series of principles to ensure that scalability and usability are never mutually exclusive:
-
-### Everything works in isolation
-
-Each system must work as a standalone tool with as few moving parts as possible.
-The litmus test for this is: "Can a user run this product with nothing but a Postgres database?"
-
-### Everything is integrated
-
-Supabase is composable. Even though every product works in isolation, each product on the platform needs to 10x the other products.
-For integration, each tool should expose an API and Webhooks.
-
-### Everything is extensible
-
-We're deliberate about adding a new tool, and prefer instead to extend an existing one.
-This is the opposite of many cloud providers whose product offering expands into niche use-cases. We provide _primitives_ for developers, which allow them to achieve any goal.
-Less, but better.
-
-### Everything is portable
-
-To avoid lock-in, we make it easy to migrate in and out. Our cloud offering is compatible with our self-hosted product.
-We use existing standards to increase portability (like pg_dump an CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard.
-This forces us compete on experience. We aim to be the best Postgres hosting service.
-
-### Play the long game
-
-We sacrifice short-term wins for long-term gains. For example, it is tempting to run a fork of Postgres with additional functionality which only our customers need.
-Instead, we prefer to support efforts to upstream missing functionality so that the entire community benefits. This has the additional benefit of ensuring portability and longevity.
-
-### Build for developers
-
-"Developers" are a specific profile of user: they are _builders_.
-When assessing impact as a function of effort, developers have a large efficiency due to the type of products and systems they can build.
-As the profile of a developer changes over time, Supabase will continue to evolve the product to fit this evolving profile.
-
-### Support existing tools
-
-Supabase supports existing tools and communities wherever possible. Supabase is more like a "community of communities" - each tool typically has its own community
-which we work with.
-Open source is something we approach [collaboratively](https://supabase.com/blog/supabase-series-b#giving-back): we employ maintainers, sponsor projects, invest in businesses, and develop our own open source tools.
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/features.mdx b/apps/docs/pages/features.mdx
deleted file mode 100755
index 4b10f3830ba..00000000000
--- a/apps/docs/pages/features.mdx
+++ /dev/null
@@ -1,184 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'features',
- title: 'Features',
- description: 'Supabase features',
-}
-
-This is a non-exhaustive list of features that Supabase provides for every project.
-
-## Database
-
-### Postgres Database
-
-Every project is a full Postgres database. [Docs](/docs/guides/database).
-
-### Database Extensions
-
-Every database comes with a full set of Postgres extensions. [Docs](/docs/guides/database/extensions).
-
-### Database Functions
-
-Create custom database functions which you can call from the browser. [Docs](/docs/guides/database/functions).
-
-### Database Triggers
-
-Attach triggers to your tables to handle database changes. [Docs](/docs/guides/auth/managing-user-data#using-triggers).
-
-### Database Webhooks
-
-Send database changes to any external service using Webhooks. [Link](https://supabase.com/blog/supabase-functions-updates#database-webhooks-alpha).
-
-### Database Backups
-
-Projects are backed up daily with the option to upgrade to Point in Time recovery.
-
-### Search
-
-Build search functionality using Postgres Full Text Search. [Docs](/docs/guides/database/full-text-search).
-
-### Secrets and encryption
-
-Encrypt sensitive data and store secrets using our Postgres extension, Supabase Vault. [Link](https://supabase.com/blog/supabase-vault).
-
-### Database migrations
-
-Develop locally and push your changes to your production database using migrations. [Docs](/docs/guides/cli/local-development#database-migrations)
-
-
-
-## Auth
-
-### Email & Password Logins
-
-Build email logins for your application or website. [Docs](/docs/guides/auth/auth-email).
-
-### Magic Links
-
-Build passwordless logins for your application or website.[Docs](/docs/guides/auth/auth-magic-link).
-
-### Social Logins
-
-Provide social logins - everything from Apple, to GitHub, to Slack. [Docs](/docs/guides/auth/auth-apple).
-
-### Phone Logins
-
-Provide phone logins using a 3rd-party SMS provider. [Docs](/docs/guides/auth/auth-twilio).
-
-### Row Level Security
-
-Control the data each user can access with Postgres Policies. [Docs](/docs/guides/auth/row-level-security).
-
-### Serverside Auth Helpers
-
-Helpers for implementing user authentication in popular frameworks like [Next.js](/docs/guides/auth/auth-helpers/nextjs) and [SvelteKit](/docs/guides/auth/auth-helpers/sveltekit)
-
-### Auth UI Kit
-
-Build login and registration pages with custom themes. [Docs](/docs/guides/auth/auth-helpers/auth-ui).
-
-
-
-## APIs & Client libraries
-
-### Auto-generated REST API
-
-RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview).
-
-### Auto-generated GraphQL API
-
-Fast GraphQL APIs using our custom Postgres GraphQL extension. [Docs](/docs/guides/api#graphql-api-overview).
-
-### Realtime Database changes
-
-Receive your database changes through websockets. [Docs](/docs/guides/realtime/postgres-changes).
-
-### User Broadcasting
-
-Send messages between connected users through websockets. [Docs](/docs/guides/realtime#broadcast).
-
-### User Presence
-
-Synchronize shared state across your users, including online status and typing indicators. [Docs](/docs/guides/realtime#presence).
-
-### Client libraries
-
-Official client libraries for [JavaScript](/docs/reference/javascript/) and [Dart](/docs/reference/dart).
-Unofficial libraries [supported by the community](https://github.com/supabase-community#client-libraries).
-
-
-
-## Storage
-
-### File storage
-
-Supabase Storage makes it simple to store and serve files. [Docs](/docs/guides/storage).
-
-### Storage CDN
-
-Cache large files using the Supabase CDN. [Docs](/docs/guides/storage-cdn).
-
-### Image Transformations
-
-Transform images on the fly. [Docs](/docs/guides/storage/image-transformations).
-
-
-
-## Edge Functions
-
-### Deno Edge Functions
-
-Globally distributed TypeScript functions to execute custom business logic. [Docs](/docs/guides/functions).
-
-
-
-## Project Management
-
-### CLI
-
-Use our CLI to develop your project locally and deploy to the Supabase Platform. [Docs](/docs/reference/cli).
-
-### Management API
-
-Manage your projects programmatically. [Docs](/docs/reference/api).
-
-
-
-## Feature Status
-
-Both Postgres and the Supabase Platform are production-ready. Some tools we offer on top of Postgres are still under development.
-
-| Product | Feature | Stage |
-| -------------------------- | ---------------------- | ------- |
-| Database | Postgres | `GA` |
-| Database | Triggers | `GA` |
-| Database | Functions | `GA` |
-| Database | Extensions | `GA` |
-| Database | Full Text Search | `GA` |
-| Database | Webhooks | `alpha` |
-| Database | Point-in-Time Recovery | `alpha` |
-| Database | Vault | `alpha` |
-| Studio | | `GA` |
-| Realtime | Postgres Changes | `GA` |
-| Realtime | Broadcast | `beta` |
-| Realtime | Presence | `beta` |
-| Storage | | `GA` |
-| Storage | S3 Backend | `GA` |
-| Storage | CDN | `GA` |
-| Storage | Smart CDN | `beta` |
-| Storage | Image Transformations | `beta` |
-| Edge Functions | | `beta` |
-| Auth | OAuth Providers | `beta` |
-| Auth | Passwordless | `beta` |
-| Auth | Next.js Auth Helpers | `alpha` |
-| Auth | SvelteKit Auth Helpers | `alpha` |
-| Auth | Remix Auth Helpers | `alpha` |
-| Management API | | `beta` |
-| CLI | | `beta` |
-| Client Library: JavaScript | | `GA` |
-| Client Library: Dart | | `beta` |
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth.mdx b/apps/docs/pages/guides/auth.mdx
deleted file mode 100644
index 85b1fdc96da..00000000000
--- a/apps/docs/pages/guides/auth.mdx
+++ /dev/null
@@ -1,185 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-import NewContent from '~/pages/new/auth.mdx'
-import { useRouter } from 'next/router'
-
-export const meta = {
- id: 'auth',
- title: 'Auth',
- description: 'Use Supabase to Authenticate and Authorize your users.',
- sidebar_label: 'Overview',
-}
-
-## Overview
-
-There are two parts to every Auth system:
-
-- **Authentication:** should this person be allowed in? If yes, who are they?
-- **Authorization:** once they are in, what are they allowed to do?
-
-Supabase Auth is designed to work either as a standalone product, or deeply integrated with the other Supabase products.
-Postgres is at the heart of everything we do, and the Auth system follows this principle. We leverage Postgres' built-in Auth functionality wherever possible.
-
-Here's a quick, 2 minute tour of the Auth features built-in to Supabase:
-
-
-
-
-
-## Authentication
-
-You can authenticate your users in several ways:
-
-- Email & password.
-- Magic links (one-click logins).
-- Social providers.
-- Phone logins.
-
-### Providers
-
-We provide a suite of Providers and login methods, as well as [Auth helpers](/docs/guides/auth/auth-helpers/).
-
-
-
-
-
-### Configure third-party providers
-
-You can enable third-party providers with the click of a button by navigating to Authentication > Settings > Auth Providers and inputting your `Client ID` and `Secret` for each.
-
-
-
-### Redirect URLs and wildcards
-
-When using third-party providers, the [Supabase client library](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect) redirects the user to the provider. When the third-party provider successfully authenticates the user, the provider redirects the user to the Supabase Auth callback URL where they are further redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or [add additional redirect URLs](https://app.supabase.com/project/_/auth/settings).
-
-You can use wildcard match patterns to support preview URLs from providers like Netlify and Vercel. See the [full list of supported patterns](https://pkg.go.dev/github.com/gobwas/glob#Compile). Use [this tool](https://www.digitalocean.com/community/tools/glob?comments=true&glob=http%3A%2F%2Flocalhost%3A3000%2F%2A%2A&matches=false&tests=http%3A%2F%2Flocalhost%3A3000&tests=http%3A%2F%2Flocalhost%3A3000%2F&tests=http%3A%2F%2Flocalhost%3A3000%2F%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest-test%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest%2Ftest%3Ftest%3Dtest) to test your patterns.
-
-> ⚠️ WARNING: While the "globstar" (`**`) is useful for local development and preview URLs, we recommend setting the exact redirect URL path for your site URL in production.
-
-#### Netlify preview URLs
-
-For deployments with Netlify, set the `SITE_URL` to your official site URL. Add the following additional redirect URLs for local development and deployment previews:
-
-- `http://localhost:3000/**`
-- `https://**--my_org.netlify.app/**`
-
-#### Vercel preview URLs
-
-For deployments with Vercel, set the `SITE_URL` to your official site URL. Add the following additional redirect URLs for local development and deployment previews:
-
-- `http://localhost:3000/**`
-- `https://*-username.vercel.app/**`
-
-Vercel provides an environment variable for the URL of the deployment called `NEXT_PUBLIC_VERCEL_URL`. See the [Vercel docs](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) for more details. You can use this variable to dynamically redirect depending on the environment:
-
-```js
-const getURL = () => {
- let url =
- process?.env?.NEXT_PUBLIC_SITE_URL ?? // Set this to your site URL in production env.
- process?.env?.NEXT_PUBLIC_VERCEL_URL ?? // Automatically set by Vercel.
- 'http://localhost:3000/';
- // Make sure to include `https://` when not localhost.
- url = url.includes('http') ? url : `https://${url}`;
- // Make sure to including trailing `/`.
- url = url.charAt(url.length - 1) === '/' ? url : `${url}/`;
- return url;
-};
-
-const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'github'
- options: {
- redirectTo: getURL()
- }
-}
-```
-
-#### Mobile deep linking URIs
-
-For mobile applications you can use deep linking URIs. For example for your `SITE_URL` you can specify something like `com.supabase://login-callback/` and for additional redirect URLs something like `com.supabase.staging://login-callback/` if needed.
-
-## Authorization
-
-When you need granular authorization rules, nothing beats PostgreSQL's Row Level Security (RLS).
-
-Policies are PostgreSQL's rule engine. They are incredibly powerful and flexible, allowing you to write complex SQL rules which fit your unique business needs.
-
-Get started with our [Row Level Security Guides](/docs/guides/auth/row-level-security).
-
-### Row Level Security
-
-Authentication only gets you so far. When you need granular authorization rules, nothing beats PostgreSQL's [Row Level Security (RLS)](https://www.postgresql.org/docs/current/ddl-rowsecurity.html). Supabase makes it simple to turn RLS on and off.
-
-
-
-### Policies
-
-[Policies](https://www.postgresql.org/docs/current/sql-createpolicy.html) are PostgreSQL's rule engine. They are incredibly powerful and flexible, allowing you to write complex SQL rules which fit your unique business needs.
-
-
-
-With policies, your database becomes the rules engine. Instead of repetitively filtering your queries, like this ...
-
-```js
-const loggedInUserId = 'd0714948'
-let { data, error } = await supabase
- .from('users')
- .select('user_id, name')
- .eq('user_id', loggedInUserId)
-
-// console.log(data)
-// => { id: 'd0714948', name: 'Jane' }
-```
-
-... you can simply define a rule on your database table, `auth.uid() = user_id`, and your request will return the rows which pass the rule, even when you remove the filter from your middleware:
-
-```js
-let { data, error } = await supabase.from('users').select('user_id, name')
-
-// console.log(data)
-// Still => { id: 'd0714948', name: 'Jane' }
-```
-
-### How It Works
-
-1. A user signs up. Supabase creates a new user in the `auth.users` table.
-2. Supabase returns a new JWT, which contains the user's `UUID`.
-3. Every request to your database also sends the JWT.
-4. Postgres inspects the JWT to determine the user making the request.
-5. The user's UID can be used in policies to restrict access to rows.
-
-Supabase provides a special function in Postgres, `auth.uid()`, which extracts the user's UID from the JWT. This is especially useful when creating policies.
-
-## User Management
-
-Supabase provides multiple endpoints to authenticate and manage your users:
-
-- [Sign up](/docs/reference/javascript/auth-signup)
-- [Sign in with password](/docs/reference/javascript/auth-signinwithpassword)
-- [Sign in with passwordless / one-time password (OTP)](/docs/reference/javascript/auth-signinwithotp)
-- [Sign in with OAuth](/docs/reference/javascript/auth-signinwithoauth)
-- [Sign out](/docs/reference/javascript/auth-signout)
-
-When users sign up, Supabase assigns them a unique ID. You can reference this ID anywhere in your database. For example, you might create a `profiles` table referencing `id` in the `auth.users` table using a `user_id` field.
-
-
-
-export const Page = ({ children }) => {
- const router = useRouter()
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true' && !router.asPath.includes('overview')) {
- return NewContent()
- }
- return
-}
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-apple.mdx b/apps/docs/pages/guides/auth/auth-apple.mdx
deleted file mode 100644
index d5bf22f9205..00000000000
--- a/apps/docs/pages/guides/auth/auth-apple.mdx
+++ /dev/null
@@ -1,207 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-apple',
- title: 'Login with Apple',
- description: 'Add Apple OAuth to your Supabase project',
-}
-
-To enable Apple Auth for your project, you need to set up an Apple OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Apple OAuth consists of six broad steps:
-
-- Obtaining an `App Id` with “Sign In with Apple” capabilities.
-- Obtaining a `Services Id` - this will serve as the `client_id`.
-- Obtaining a `secret key` that will be used to get our `client_secret`.
-- Generating the `client_secret` using the `secret key`.
-- Add your `client id` and `client secret` keys to your [Supabase Project](https://app.supabase.com).
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
-
-## Access your Apple Developer account
-
-- Go to [developer.apple.com](https://developer.apple.com).
-- Click on `Account` at the top right to log in.
-
-
-
-## Obtain an App ID
-
-- Go to `Certificates, Identifiers & Profiles`.
-- Click on `Identifiers` at the left.
-- Click on the `+` sign in the upper left next to `Identifiers`.
-- Select `App IDs` and click `Continue`.
-- Select type `App` and click `Continue`.
-- Fill out your app information:
- - App description.
- - Bundle ID (Apple recommends reverse-domain name style, so if your domain is acme.com and your app is called roadrunner, use: "com.acme.roadrunner").
- - Scroll down and check `Sign In With Apple`.
- - Click `Continue` at the top right.
- - Click `Register` at the top right.
-
-## Obtain a Services ID
-
-This will serve as the `client_id` when you make API calls to authenticate the user.
-
-- Go to `Certificates, Identifiers & Profiles`.
-- Click on `Identifiers` at the left.
-- Click on the `+` sign in the upper left next to `Identifiers`.
-- Select `Services IDs` and click `Continue`.
-- Fill out your information:
- - App description.
- - Bundle ID (you can't use the same Bundle ID from the previous step, but you can just add something to the beginning, such as "app." to make it app.com.acme.roadrunner").
- - SAVE THIS ID -- this ID will become your `client_id` later.
- - Click `Continue` at the top right.
- - Click `Register` at the top right.
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Configure your Services ID
-
-- Under `Identifiers`, click on your newly-created Services ID.
-- Check the box next to `Sign In With Apple` to enable it.
-- Click `Configure` to the right.
-- Make sure your newly created Bundle ID is selected under `Primary App ID`
-- Add your domain to the `Domains and Subdomains` box (do not add `https://`, just add the domain).
-- In the `Return URLs` box, type the callback URL of your app which you found in the previous step and click `Next` at the bottom right.
-- Click `Done` at the bottom.
-- Click `Continue` at the top right.
-- Click `Save` at the top right.
-
-## Download your secret key
-
-Now you'll need to download a `secret key` file from Apple that will be used to generate your `client_secret`.
-
-- Go to `Certificates, Identifiers & Profiles`.
-- Click on `Keys` at the left.
-- Click on the `+` sign in the upper left next to `Keys`.
-- Enter a `Key Name`.
-- Check `Sign In with Apple`.
-- Click `Configure` to the right.
-- Select your newly-created Services ID from the dropdown selector.
-- Click `Save` at the top right.
-- Click `Continue` at the top right.
-- Click `Register` at the top right.
-- Click `Download` at the top right.
-- Save the downloaded file -- this contains your "secret key" that will be used to generate your `client_secret`.
-- Click `Done` at the top right.
-
-## Generate a `client_secret`
-
-The `secret key` you downloaded is used to create the `client_secret` string you'll need to authenticate your users.
-
-According to the [Apple Docs](https://developer.apple.com/documentation/signinwithapplerestapi/generate_and_validate_tokens) it needs to be a JWT
-token encrypted using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm.
-
-At this time, the easiest way to generate this JWT token is with [Ruby](https://www.ruby-lang.org/en/).
-If you don't have Ruby installed, you can [Download Ruby Here](https://www.ruby-lang.org/en/downloads).
-
-- Install Ruby (or check to make sure it's installed on your system).
-- Install [ruby-jwt](https://github.com/jwt/ruby-jwt).
-- From the command line, run: `sudo gem install jwt`.
-
-Create the script below using a text editor: `secret_gen.rb`
-
-```ruby
-require "jwt"
-
-key_file = "Path to the private key"
-team_id = "Your Team ID"
-client_id = "The Service ID of the service you created"
-key_id = "The Key ID of the private key"
-
-validity_period = 180 # In days. Max 180 (6 months) according to Apple docs.
-
-private_key = OpenSSL::PKey::EC.new IO.read key_file
-
-token = JWT.encode(
- {
- iss: team_id,
- iat: Time.now.to_i,
- exp: Time.now.to_i + 86400 * validity_period,
- aud: "https://appleid.apple.com",
- sub: client_id
- },
- private_key,
- "ES256",
- header_fields=
- {
- kid: key_id
- }
-)
-puts token
-```
-
-1. Edit the `secret_gen.rb` file:
-
-- `key_file` = "Path to the private key you downloaded from Apple". It should look like this: `AuthKey_XXXXXXXXXX.p8`.
-- `team_id` = "Your Team ID". This is found at the top right of the Apple Developer site (next to your name).
-- `client_id` = "The Service ID of the service you created". This is the `Services ID` you created in the above step `Obtain a Services ID`. If you've lost this ID, you can find it in the Apple Developer Site:
- - Go to `Certificates, Identifiers & Profiles`.
- - Click `Identifiers` at the left.
- - At the top right drop-down, select `Services IDs`.
- - Find your Identifier in the list (i.e. app.com.acme.roadrunner).
-- `key_id` = "The Key ID of the private key". This can be found in the name of your downloaded secret file (For a file named `AuthKey_XXXXXXXXXX.p8` your key_id is `XXXXXXXXXX`). If you've lost this ID, you can find it in the Apple Developer Site:
- - Go to `Certificates, Identifiers & Profiles`.
- - Click `Keys` at the left.
- - Click on your newly-created key in the list.
- - Look under `Key ID` to find your key_id.
-
-2. From the command line, run: `ruby secret_gen.rb > client_secret.txt`.
-3. Your `client_secret` is now stored in this `client_secret.txt` file.
-
-## Add your OAuth credentials to Supabase
-
-- Go to your [Supabase Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `Apple Enabled` to ON.
-- Enter your `client_id` and `client_secret` saved in the previous steps.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `apple` as the `provider`:
-
-```js
-async function signInWithApple() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'apple',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Apple Developer Account](https://developer.apple.com).
-- [Ruby](https://www.ruby-lang.org/en/) Docs.
-- [ruby-jwt](https://github.com/jwt/ruby-jwt) library.
-- Thanks to [Janak Amarasena](https://medium.com/@janakda) who did all the heavy lifting in [How to configure Sign In with Apple](https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003).
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-azure.mdx b/apps/docs/pages/guides/auth/auth-azure.mdx
deleted file mode 100644
index d75a365b1d5..00000000000
--- a/apps/docs/pages/guides/auth/auth-azure.mdx
+++ /dev/null
@@ -1,103 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-azure',
- title: 'Login with Azure',
- description: 'Add Azure OAuth to your Supabase project',
-}
-
-To enable Azure Auth for your project, you need to set up an Azure OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Azure OAuth consists of four broad steps:
-
-- Create an application under Azure Active Directory.
-- Obtain a `Application (client) ID` with “Sign In with Azure” capabilities. This will be used as the `client id`.
-- Create a `Secret ID` with “Sign In with Azure” capabilities. The value of the secret will be used as the `client secret`.
-- Add the callback url of your application to the allowlist.
-
-## Access your Azure Developer account
-
-- Go to [portal.azure.com](https://portal.azure.com/#home).
-- Login and select "Azure Active Directory" under the list of Azure Services.
-
-## Register an application
-
-- Under Azure Active Directory, select "App registrations" in the side panel.
-- Select "New registration".
-- Choose a name and select your preferred option for the supported account types.
-- Specify the "Redirect URI".
-- The redirect / callback URI should look like this: `https://.supabase.co/auth/v1/callback`
-- Click "Register" at the bottom of the form.
-
-
-
-## Obtain a Client ID
-
-This will serve as the `client_id` when you make API calls to authenticate the user.
-
-- Once your app has been registered, the client id can be found under the [list of app registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) under the column titled "Application (client) ID".
-
-
-
-## Obtain a Secret ID
-
-This will serve as the `client_secret` when you make API calls to authenticate the user.
-
-- Click on the name of the app registered above.
-- Under "Essentials", click on "Client credentials".
-- Navigate to the "Client secrets" tab and select "New client secret".
-- Enter a description and choose your preferred expiry for the secret.
-- Once the secret is generated, save the `value` (not the secret ID).
-
-
-
-## Obtain the Tenant URL
-
-This will allow your users to use your custom Azure login page when logging in.
-
-- Select the Directory (Tenant) ID value.
-- The Azure Tenant URL should look like this: `https://login.microsoftonline.com/`
-
-
-
-## Add login code to your client app
-
-
-
-Supabase Auth requires that Azure returns a valid email address. Therefore you must request the `email` scope in the `signIn` method above.
-
-
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `azure` as the `provider`:
-
-```js
-async function signInWithAzure() {
- const { data, error } = await supabase.auth.signInWithOAuth(
- {
- provider: 'azure',
- },
- {
- scopes: 'email',
- }
- )
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Azure Developer Account](https://portal.azure.com)
-- [GitHub Discussion](https://github.com/supabase/gotrue/pull/54#issuecomment-757043573)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-bitbucket.mdx b/apps/docs/pages/guides/auth/auth-bitbucket.mdx
deleted file mode 100644
index 626b1ef3cf7..00000000000
--- a/apps/docs/pages/guides/auth/auth-bitbucket.mdx
+++ /dev/null
@@ -1,95 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-bitbucket',
- title: 'Login with Bitbucket',
- description: 'Add Bitbucket OAuth to your Supabase project',
-}
-
-To enable Bitbucket Auth for your project, you need to set up a BitBucket OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Bitbucket logins for your application consists of 3 parts:
-
-- Create and configure a Bitbucket OAuth Consumer on [Bitbucket](https://bitbucket.org)
-- Add your Bitbucket OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Bitbucket account
-
-- Go to [bitbucket.org](https://bitbucket.org/).
-- Click on `Login` at the top right to log in.
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Bitbucket OAuth app
-
-- Click on your profile icon at the bottom left
-- Click on `All Workspaces`
-- Select a workspace and click on it to select it
-- Click on `Settings` on the left
-- Click on `OAuth consumers` on the left under `Apps and Features` (near the bottom)
-- Click `Add Consumer` at the top
-- Enter the name of your app under `Name`
-- In `Callback URL`, type the callback URL of your app
-- Check the permissions you need (Email, Read should be enough)
-- Click `Save` at the bottom
-- Click on your app name (the name of your new OAuth Consumer)
-- Copy your `Key` (`client_key`) and `Secret` (`client_secret`) codes
-
-## Add your Bitbucket credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Bitbucket Enabled` to ON
-- Enter your `client_id` and `client_secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `bitbucket` as the `provider`:
-
-```js
-async function signInWithBitbucket() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'bitbucket',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Bitbucket Account](https://bitbucket.org)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-discord.mdx b/apps/docs/pages/guides/auth/auth-discord.mdx
deleted file mode 100644
index dc599979d0e..00000000000
--- a/apps/docs/pages/guides/auth/auth-discord.mdx
+++ /dev/null
@@ -1,97 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-discord',
- title: 'Login with Discord',
- description: 'Add Discord OAuth to your Supabase project',
-}
-
-To enable Discord Auth for your project, you need to set up a Discord Application and add the Application OAuth credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Discord logins for your application consists of 3 parts:
-
-- Create and configure a Discord Application [Discord Developer Portal](https://discord.com/developers)
-- Add your Discord OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Discord account
-
-- Go to [discord.com](https://discord.com/).
-- Click on `Login` at the top right to log in.
-
-
-
-- Once logged in, go to [discord.com/developers](https://discord.com/developers).
-
-
-
-## Find your callback URL
-
-In the next step you require a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Discord Application
-
-- Click on `New Application` at the top right.
-- Enter the name of your application and click `Create`.
-- Click on `OAuth2` under `Settings` in the left side panel.
-- Click `Add Redirect` under `Redirects`.
-- Type or paste your `callback URL` into the `Redirects` box.
-- Click `Save Changes` at the bottom.
-- Copy your `Client ID` and `Client Secret` under `Client information`.
-
-## Add your Discord credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Discord Enabled` to ON
-- Enter your `client_id` and `client_secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `discord` as the `provider`:
-
-```js
-async function signInWithDiscord() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'discord',
- })
-}
-```
-
-If your user is already signed in, Discord prompts the user again for authorization.
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Discord Account](https://discord.com)
-- [Discord Developer Portal](https://discord.com/developers)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-facebook.mdx b/apps/docs/pages/guides/auth/auth-facebook.mdx
deleted file mode 100644
index 43658f38b00..00000000000
--- a/apps/docs/pages/guides/auth/auth-facebook.mdx
+++ /dev/null
@@ -1,112 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-facebook',
- title: 'Login with Facebook',
- description: 'Add Facebook OAuth to your Supabase project',
-}
-
-To enable Facebook Auth for your project, you need to set up a Facebook OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Facebook logins for your application consists of 3 parts:
-
-- Create and configure a Facebook Application on the [Facebook Developers Site](https://developers.facebook.com)
-- Add your Facebook keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Facebook Developer account
-
-- Go to [developers.facebook.com](https://developers.facebook.com).
-- Click on `Log In` at the top right to log in.
-
-
-
-## Create a Facebook App
-
-- Click on `My Apps` at the top right.
-- Click `Create App` near the top right.
-- Select your app type and click `Continue`.
-- Fill in your app information, then click `Create App`.
-- This should bring you to the screen: `Add Products to Your App`. (Alternatively you can click on `Add Product` in the left sidebar to get to this screen.)
-
-## Find your callback URI
-
-The next step requires a callback URI, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Set up FaceBook Login for your Facebook App
-
-From the `Add Products to your App` screen:
-
-- Click `Setup` under `Facebook Login`
-- Skip the Quickstart screen, instead, in the left sidebar, click `Settings` under `Facebook Login`
-- Enter your callback URI under `Valid OAuth Redirect URIs` on the `Facebook Login Settings` page
-- Enter this in the `Valid OAuth Redirect URIs` box
-- Click `Save Changes` at the bottom right
-
-Be aware that you have to set the right access levels on your Facebook App to enable 3rd party applications to read the email address.
-From the `App Review -> Permissions and Features` screen:
-
-- Click the button `Request Advanced Access` on the right side of `public_profile` and `email`
-
-You can read more about access levels [here](https://developers.facebook.com/docs/graph-api/overview/access-levels/)
-
-## Copy your Facebook App ID and Secret
-
-- Click `Settings / Basic` in the left sidebar
-- Copy your App ID from the top of the `Basic Settings` page
-- Under `App Secret` click `Show` then copy your secret
-- Make sure all required fields are completed on this screen.
-
-## Enter your Facebook App ID and Secret into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Facebook Enabled` to ON
-- Enter your `Facebook client ID` and `Facebook secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `facebook` as the `provider`:
-
-```js
-async function signInWithFacebook() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'facebook',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Facebook Developers Dashboard](https://developers.facebook.com/)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-github.mdx b/apps/docs/pages/guides/auth/auth-github.mdx
deleted file mode 100644
index 6ddcdac1ede..00000000000
--- a/apps/docs/pages/guides/auth/auth-github.mdx
+++ /dev/null
@@ -1,105 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-github',
- title: 'Login with GitHub',
- description: 'Add GitHub OAuth to your Supabase project',
-}
-
-To enable GitHub Auth for your project, you need to set up a GitHub OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up GitHub logins for your application consists of 3 parts:
-
-- Create and configure a GitHub OAuth App on [GitHub](https://github.com)
-- Add your GitHub OAuth keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your GitHub account
-
-- Go to [github.com](https://github.com).
-- Click on `Sign In` at the top right to log in.
-
-
-
-## Create a GitHub Oauth App
-
-Go to the [GitHub Developer Settings](https://github.com/settings/developers) page:
-
-- Click on your profile photo at the top right
-- Click Settings near the bottom of the menu
-- In the left sidebar, click `Developer settings` (near the bottom)
-- In the left sidebar, click `OAuth Apps`
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Register a new OAuth application
-
-- Click `Register a new application`. If you've created an app before, click `New OAuth App` here.
-- In `Application name`, type the name of your app.
-- In `Homepage URL`, type the full URL to your app's website.
-- In `Authorization callback URL`, type the callback URL of your app.
-- Enter the URL in the `Valid OAuth Redirect URIs` box.
-- Click `Save Changes` at the bottom right.
-- Click `Register Application`.
-
-Copy your new OAuth credentials
-
-- Copy and save your `Client ID`.
-- Click `Generate a new client secret`.
-- Copy and save your `Client secret`.
-
-## Enter your GitHub credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `GitHub Enabled` to ON
-- Enter your `GitHub Client ID` and `GitHub Client Secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `github` as the `provider`:
-
-```js
-async function signInWithGitHub() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'github',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [GitHub Developer Settings](https://github.com/settings/developers)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-gitlab.mdx b/apps/docs/pages/guides/auth/auth-gitlab.mdx
deleted file mode 100644
index 870c292a0b8..00000000000
--- a/apps/docs/pages/guides/auth/auth-gitlab.mdx
+++ /dev/null
@@ -1,92 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-gitlab',
- title: 'Login with GitLab',
- description: 'Add GitLab OAuth to your Supabase project',
-}
-
-To enable GitLab Auth for your project, you need to set up a GitLab OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up GitLab logins for your application consists of 3 parts:
-
-- Create and configure a GitLab Application on [GitLab](https://gitlab.com)
-- Add your GitLab Application keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your GitLab account
-
-- Go to [gitlab.com](https://gitlab.com).
-- Click on `Login` at the top right to log in.
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create your GitLab Application
-
-- Click on your `profile logo` (avatar) in the top-right corner.
-- Select `Edit profile`.
-- In the left sidebar, select Applications.
-- Enter the name of the application.
-- In the `Redirect URI` box, type the callback URL of your app.
-- Check the box next to `Confidential` (make sure it is checked).
-- Check the scope named `read_user` (this is the only required scope).
-- Click `Save Application` at the bottom.
-- Copy and save your `Application ID` (`client_id`) and `Secret` (`client_secret`) which you'll need later.
-
-## Add your GitLab credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `GitLab Enabled` to ON.
-- Enter your `client_id` and `client_secret` saved in the previous step.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `gitlab` as the `provider`:
-
-```js
-async function signInWithGitLab() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'gitlab',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [GitLab Account](https://gitlab.com)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-google.mdx b/apps/docs/pages/guides/auth/auth-google.mdx
deleted file mode 100644
index 4a8a2c3b222..00000000000
--- a/apps/docs/pages/guides/auth/auth-google.mdx
+++ /dev/null
@@ -1,120 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-google',
- title: 'Login with Google',
- description: 'Add Google OAuth to your Supabase project',
-}
-
-To enable Google Auth for your project, you need to set up a Google OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Google logins for your application consists of 3 parts:
-
-- Create and configure a Google Project on the [Google Cloud Platform Console](https://console.cloud.google.com/home/dashboard)
-- Add your Google OAuth keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Google Cloud Platform account
-
-- Go to [cloud.google.com](https://cloud.google.com).
-- Click on `Sign in` at the top right to log in.
-
-
-
-## Create a Google Cloud Platform Project
-
-- Click on `Select a Project` at the top left.
- - (Or, if a project is currently selected, click on the current project name at the top left.)
-- Click `New Project` at the top right.
-- Fill in your app information, then click `Create`.
- - (This can take a few minutes.)
-- This should bring you to the dashboard for your new project.
-
-## Create the OAuth Keys for your project
-
-From your project's dashboard screen:
-
-- In the search bar at the top labeled `Search products and resources` type `OAuth`.
-- Click on `OAuth consent screen` from the list of results.
-- On the `OAuth consent screen` page select `External`.
-- Click `Create`.
-
-## Edit your app information
-
-- On the `Edit app registration` page fill out your app information.
-- Click `Save and continue` at the bottom.
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create your Google credentials
-
-- Click `Credentials` at the left to go to the `Credentials` page on the Google Cloud Platform console.
-- Click `Create Credentials` near the top then select `OAuth client ID`
-- On the `Create OAuth client ID` page, select your application type. If you're not sure, choose `Web application`.
-- Fill in your app name.
-- At the bottom, under `Authorized redirect URIs` click `Add URI`.
-- Enter your callback URI under `Authorized redirect URIs` at the bottom.
-- Enter your callback URI in the `Valid OAuth Redirect URIs` box.
-- Click `Save Changes` at the bottom right.
-- Click `Create`.
-
-Copy your new OAuth credentials
-
-- A box will appear called `OAuth client created`.
-- Copy and save the values under `Your Client ID` and `Your Client Secret`.
-
-## Enter your Google credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Google Enabled` to ON
-- Enter your `Google Client ID` and `Google Client Secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `google` as the `provider`:
-
-```js
-async function signInWithGoogle() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'google',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Google Cloud Platform Console](https://console.cloud.google.com/home/dashboard)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-keycloak.mdx b/apps/docs/pages/guides/auth/auth-keycloak.mdx
deleted file mode 100644
index b0078e6cfae..00000000000
--- a/apps/docs/pages/guides/auth/auth-keycloak.mdx
+++ /dev/null
@@ -1,92 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-keycloak',
- title: 'Login with Keycloak',
- description: 'Add Keycloak OAuth to your Supabase project',
-}
-
-To enable Keycloak Auth for your project, you need to set up an Keycloak OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-To get started with Keycloak, you can run it in a docker container with: `docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8080:8080 jboss/keycloak:latest`
-
-This guide will be assuming that you are running keycloak in a docker container as described in the command above.
-
-Keycloak OAuth consists of five broad steps:
-
-- Create a new client in your specified keycloak realm.
-- Obtain the `issuer` from the "OpenID Endpoint Configuration". This will be used as the `Keycloak URL`.
-- Ensure that the new client has the "Client Protocol" set to "openid-connect" and the "Access Type" is set to "confidential".
-- The `Client ID` of the client created will be used as the `client id`.
-- Obtain the `Secret` from the credentials tab which will be used as the `client secret`.
-- Add the callback url of your application to your allowlist.
-
-## Access your Keycloak Admin console
-
-- Login by visiting [`http://localhost:8080`](http://localhost:8080) and clicking on "Administration Console".
-
-## Create a Keycloak Realm
-
-- Once you've logged in to the Keycloak console, you can add a realm from the side panel. The default realm should be named "Master".
-- After you've added a new realm, you can retrieve the `issuer` from the "OpenID Endpoint Configuration" endpoint. The `issuer` will be used as the `Keycloak URL`.
-- You can find this endpoint from the realm settings under the "General Tab" or visit [`http://localhost:8080/realms/my_realm_name/.well-known/openid-configuration`](http://localhost:8080/realms/my_realm_name/.well-known/openid-configuration)
-
-
-
-## Create a Keycloak Client
-
-The "Client ID" of the created client will serve as the `client_id` when you make API calls to authenticate the user.
-
-
-
-## Client Settings
-
-After you've created the client successfully, ensure that you set the following settings:
-
-1. The "Client Protocol" should be set to "openid-connect".
-2. The "Access Type" should be set to "confidential".
-3. The "Valid Redirect URIs" should be set to: `https://.supabase.co/auth/v1/callback`.
-
-
-
-
-## Obtain the Client Secret
-
-This will serve as the `client_secret` when you make API calls to authenticate the user.
-Under the "Credentials" tab, the `Secret` value will be used as the `client secret`.
-
-
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `keycloak` as the `provider`:
-
-```js
-async function signInWithKeycloak() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'keycloak',
- options: {
- scopes: 'openid',
- },
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- You can find the keycloak openid endpoint configuration under the realm settings.
- 
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-linkedin.mdx b/apps/docs/pages/guides/auth/auth-linkedin.mdx
deleted file mode 100644
index 22fb6f1f05e..00000000000
--- a/apps/docs/pages/guides/auth/auth-linkedin.mdx
+++ /dev/null
@@ -1,91 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-linkedin',
- title: 'Login with LinkedIn',
- description: 'Add LinkedIn OAuth to your Supabase project',
-}
-
-To enable LinkedIn Auth for your project, you need to set up a LinkedIn OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up LinkedIn logins for your application consists of 3 parts:
-
-- Create and configure a LinkedIn Project and App on the [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
-- Add your LinkedIn `client_id` and `client_secret` to your [Supabase Project](https://app.supabase.com).
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
-
-## Access your LinkedIn Developer account
-
-- Go to [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
-- Log in (if necessary.)
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a LinkedIn OAuth app
-
-- Go to [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
-- Click on `Create App` at the top right
-- Enter your `LinkedIn Page` and `App Logo`
-- Save your app
-- Click `Auth` from the top menu
-- Add your `Redirect URL` to the `Authorized Redirect URLs for your app` section
-- Copy and save your newly-generated `Client ID`
-- Copy and save your newly-generated `Client Secret`
-
-## Enter your LinkedIn credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `LinkedIn Enabled` to ON.
-- Enter your `client_id` and `client_secret` saved in the previous step.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `linkedin` as the `provider`:
-
-```js
-async function signInWithLinkedIn() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'linkedin',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [LinkedIn Developer Dashboard](https://api.LinkedIn.com/apps)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-magic-link.mdx b/apps/docs/pages/guides/auth/auth-magic-link.mdx
deleted file mode 100644
index 181954436ae..00000000000
--- a/apps/docs/pages/guides/auth/auth-magic-link.mdx
+++ /dev/null
@@ -1,96 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-magic-link',
- title: 'Login With Magic Link',
- description: 'Use Supabase to authenticate and authorize your users using magic links.',
-}
-
-Magic links are a form of passwordless logins where users click on a link sent to their email address to log in to their accounts.
-Magic links only work with email addresses. By default, a user can only request a magic link once every 60 seconds.
-
-## Overview
-
-Setting up Magic Link logins for your Supabase application.
-
-- Add Magic Link authenticator to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your application - [JavaScript](https://github.com/supabase/supabase-js) | [Flutter](https://github.com/supabase/supabase-flutter)
-
-## Add Magic Link into your Supabase Project
-
-1. For [Site URL](https://app.supabase.com/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
-1. For [Auth Providers](https://app.supabase.com/project/_/auth/providers), **enable email provider**.
-
-## Add login code to your client app
-
-
-
-
-When your user signs in, call [signInWithOtp()](/docs/reference/javascript/auth-signinwithotp) with their email address:
-
-```js
-async function signInWithEmail() {
- const { data, error } = await supabase.auth.signInWithOtp({
- email: 'example@email.com',
- })
-}
-```
-
-
-
-
-When your user signs in, call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:
-
-```dart
-Future signInWithEmail() async {
- final AuthResponse res = await supabase.auth.signinwithotp(email: 'example@email.com');
-}
-```
-
-
-
-
-
-
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signOut() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-
-
-
-When your user signs out, call [signOut()](/docs/reference/dart/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```dart
-Future signOut() async {
- await supabase.auth.signOut();
-}
-```
-
-
-
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Supabase Flutter Client](https://github.com/supabase/supabase-flutter)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-messagebird.mdx b/apps/docs/pages/guides/auth/auth-messagebird.mdx
deleted file mode 100644
index 38651a9876d..00000000000
--- a/apps/docs/pages/guides/auth/auth-messagebird.mdx
+++ /dev/null
@@ -1,284 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-messagebird',
- title: 'Phone Auth with MessageBird',
- description: 'How to set up and use Mobile OTP with MessageBird and Supabase.',
-}
-
-## Overview
-
-In this guide we'll show you how to authenticate your users with SMS based OTP (One-Time Password) tokens.
-
-There are two reasons to use Supabase SMS OTP tokens:
-
-- You want users to log in with mobile + password, and the mobile should be verified via SMS
-- You want users to log in with mobile ONLY (i.e. passwordless login)
-
-We'll cover:
-
-- [Finding your MessageBird credentials](#finding-your-messagebird-credentials)
-- [Using OTP with password based logins](#using-otp-with-password-based-logins)
-- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
-
-What you'll need:
-
-- A MessageBird account (sign up here: https://dashboard.messagebird.com/en/sign-up)
-- A Supabase project (create one here: https://app.supabase.com)
-- A mobile phone capable of receiving SMS
-
-## Steps
-
-### Finding your MessageBird credentials
-
-Start by logging into your MessageBird account and verify the mobile number you'll be using to test with: https://dashboard.messagebird.com/en/getting-started/sms
-
-This is the number that will be receiving the SMS OTPs.
-
-
-
-
-
-Navigate to the [dashboard settings](https://dashboard.messagebird.com/en/settings/sms) to set the default originator. The messagebird originator is the name or number from which the message is sent.
-For more information, you can refer to the messagebird article on choosing an originator [here](https://support.messagebird.com/hc/en-us/articles/115002628665-Choosing-an-originator)
-
-
-
-You will need the following values to get started:
-
-- Live API Key / Test API Key
-- MessageBird originator
-
-Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
-
-You should see an option to enable Phone Signup.
-
-
-
-Toggle it on, and copy the 2 values over from the messagebird dashboard. Click save.
-
-Note: If you use the Test API Key, the OTP will not be delivered to the mobile number specified but messagebird will log the response in the dashboard.
-If the Live API Key is used instead, the OTP will be delivered and there will be a deduction in your free credits.
-
-Plugin MessageBird credentials
-
-Now the backend should be setup, we can proceed to add our client-side code!
-
-#### SMS custom template
-
-The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
-
-Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
-
-Use the variable `.Code` in the template to display the code.
-
-### Using OTP with password based logins
-
-In this use scenario we'll be using the user's mobile phone number as an alternative to an email address when signing up along with a password. You may want to think hard about the permanency of this however. It is not uncommon for mobile phone numbers to be recycled by phone networks when users cancel their phone contracts or move countries, therefore granting access to the user's account to whoever takes over the phone number in the future. Soon we'll add multi-factor auth, which will mitigate this risk, but for now you may want to give some thought to allowing your users to recover their account by some other means in an emergency.
-
-Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signUp({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555",
- "password": "some-password"
-}'
-```
-
-
-
-
-The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
-
-You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '+13334445555',
- token: '123456',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "+13334445555",
- "token": "123456"
-}'
-```
-
-
-
-
-If successful the user will now be logged in and you should receive a valid session like:
-
-```json
-{
- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
-}
-```
-
-The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
-
-Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithPassword({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555",
- "password": "some-password"
-}'
-```
-
-
-
-
-### Using OTP as a passwordless sign-in mechanism
-
-In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
-
-In javascript we can use the `signIn` method with a single parameter: `phone`
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithOtp({
- phone: '+13334445555',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555"
-}'
-```
-
-
-
-
-The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '+13334445555',
- token: '123456',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "+13334445555",
- "token": "123456"
-}'
-```
-
-
-
-
-and the response should also be the same as above:
-
-```json
-{
- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
-}
-```
-
-The user does not have a password therefore will need to sign in via this method each time they want to access your service.
-
-## Resources
-
-- [MessageBird Signup](https://dashboard.messagebird.com/en/sign-up)
-- [Supabase Dashboard](https://app.supabase.com)
-- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-notion.mdx b/apps/docs/pages/guides/auth/auth-notion.mdx
deleted file mode 100644
index 1f1d74e465a..00000000000
--- a/apps/docs/pages/guides/auth/auth-notion.mdx
+++ /dev/null
@@ -1,95 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-notion',
- title: 'Login with Notion',
- description: 'Add Notion OAuth to your Supabase project',
-}
-
-To enable Notion Auth for your project, you need to set up a Notion Application and add the Application OAuth credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Notion logins for your application consists of 3 parts:
-
-- Create and configure a Notion Application [Notion Developer Portal](https://www.notion.so/my-integrations)
-- Retrieve your OAuth client ID and OAuth client secret and add them to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Create your notion integration
-
-- Go to [developers.notion.com](https://developers.notion.com/).
-- Click "View my integrations" and login.
-
-
-
-- Once logged in, go to [notion.so/my-integrations](https://notion.so/my-integrations) and create a new integration.
-- When creating your integration, ensure that you select "Public integration" under "Integration type" and "Read user information including email addresses" under "Capabilities".
-- You will need to add a redirect uri, see [Add the redirect uri](#add-the-redirect-uri)
-- Once you've filled in the necessary fields, click "Submit" to finish creating the integration.
-
-
-
-## Add the redirect URI
-
-- After selecting "Public integration", you should see an option to add "Redirect URIs".
-
-
-
-You can retrieve the redirect uri with the following steps:
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-Your redirect uri should look like the following: `https://.supabase.co/auth/v1/callback`
-
-
-
-## Add your Notion credentials into your Supabase Project
-
-- Once you've created your notion integration, you should be able to retrieve the "OAuth client ID" and "OAuth client secret" from the "OAuth Domain and URIs" tab.
-
-
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Under `External OAuth Providers` turn `Notion Enabled` to ON
-- Enter the "OAuth client ID" and "OAuth client secret" obtained in the `client id` and `client secret` fields.
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `notion` as the `provider`:
-
-```js
-async function signInWithNotion() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'notion',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Notion Account](https://notion.so)
-- [Notion Developer Portal](https://www.notion.so/my-integrations)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-slack.mdx b/apps/docs/pages/guides/auth/auth-slack.mdx
deleted file mode 100644
index 6d700e6f961..00000000000
--- a/apps/docs/pages/guides/auth/auth-slack.mdx
+++ /dev/null
@@ -1,104 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-slack',
- title: 'Login with Slack',
- description: 'Add Slack OAuth to your Supabase project',
-}
-
-To enable Slack Auth for your project, you need to set up a Slack OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Slack logins for your application consists of 3 parts:
-
-- Create and configure a Slack Project and App on the [Slack Developer Dashboard](https://api.slack.com/apps).
-- Add your Slack `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
-
-## Access your Slack Developer account
-
-- Go to [api.slack.com](https://api.slack.com/apps).
-- Click on `Your Apps` at the top right to log in.
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Slack OAuth app
-
-- Go to [api.slack.com](https://api.slack.com/apps).
-- Click on `Create an App`
-
-Under `Create an app...`:
-
-- Click `From scratch`
-- Type the name of your app
-- Select your `Slack Workspace`
-- Click `Create App`
-
-Under `App Credentials`:
-
-- Copy and save your newly-generated `Client ID`
-- Copy and save your newly-generated `Client Secret`
-- Click `Permissions`
-
-Under `Redirect URLs`:
-
-- Click `Add New Redirect URL`
-- Paste your `Callback URL` then click `Add`
-- Click `Save URLs`
-
-## Enter your Slack credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `Slack Enabled` to ON.
-- Enter your `Client ID` (`client_id`) and `Client Secret` (`client_secret`) saved in the previous step.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `slack` as the `provider`:
-
-```js
-async function signInWithSlack() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'slack',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Slack Developer Dashboard](https://api.slack.com/apps)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-spotify.mdx b/apps/docs/pages/guides/auth/auth-spotify.mdx
deleted file mode 100644
index c5f3a0872f2..00000000000
--- a/apps/docs/pages/guides/auth/auth-spotify.mdx
+++ /dev/null
@@ -1,99 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-spotify',
- title: 'Login with Spotify',
- description: 'Add Spotify OAuth to your Supabase project',
-}
-
-To enable Spotify Auth for your project, you need to set up a Spotify OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Spotify logins for your application consists of 3 parts:
-
-- Create and configure a Spotify Project and App on the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/).
-- Add your Spotify `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
-
-## Access your Spotify Developer account
-
-- Log into [Spotify](https://spotify.com)
-- Access the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Spotify OAuth app
-
-- Log into [Spotify](https://spotify.com).
-- Go to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)
-- Click `Create an App`
-- Type your `App name`
-- Type your `App description`
-- Check the box to agree with the `Developer TOS and Branding Guidelines`
-- Click `Create`
-- Save your `Client ID`
-- Save your `Client Secret`
-- Click `Edit Settings`
-
-Under `Redirect URIs`:
-
-- Paste your Supabase Callback URL in the box
-- Click `Add`
-- Click `Save` at the bottom
-
-## Enter your Spotify credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `Spotify Enabled` to ON.
-- Enter your `Client ID` (`client_id`) and `Client Secret` (`client_secret`) saved in the previous step.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `spotify` as the `provider`:
-
-```js
-async function signInWithSpotify() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'spotify',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-twilio.mdx b/apps/docs/pages/guides/auth/auth-twilio.mdx
deleted file mode 100644
index fa45a547970..00000000000
--- a/apps/docs/pages/guides/auth/auth-twilio.mdx
+++ /dev/null
@@ -1,305 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-twilio',
- title: 'Phone Auth with Twilio',
- description: 'How to set up and use Mobile OTP with Twilio and Supabase.',
-}
-
-## Overview
-
-In this guide we'll show you how to authenticate your users with SMS based One-Time Password (OTP) tokens.
-
-There are two reasons to use Supabase SMS OTP tokens:
-
-- You want users to log in with mobile number + password, and the mobile number should be verified via SMS
-- You want users to log in with mobile number ONLY (i.e. passwordless login)
-
-We'll cover:
-
-- [Finding your Twilio credentials](#finding-your-twilio-credentials)
-- [Using OTP with password based logins](#using-otp-with-password-based-logins)
-- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
-
-What you'll need:
-
-- A Twilio account (sign up here: https://www.twilio.com/try-twilio)
-- A Supabase project (create one here: https://app.supabase.com)
-- A mobile phone capable of receiving SMS
-
-## Video
-
-
-
-
-
-## Steps
-
-### Finding your Twilio credentials
-
-Start by logging into your Twilio account and starting a new project: https://www.twilio.com/console/projects/create
-
-Give your project a name and verify the mobile number you'll be using to test with. This is the number that will be receiving the SMS OTPs.
-
-
-
-
-Select 'SMS', 'Identity & Verification', and 'With code' as options on the welcome form.
-
-
-
-When you're back on the [Twilio console screen](https://www.twilio.com/console), you need to scroll down and click 'Get a trial phone number' - this is the number that you'll be sending SMSs from.
-
-
-
-
-
-You should now be able to see all three values you'll need to get started:
-
-- Account SID
-- Auth Token
-- Sender Phone Number
-
-
-
-Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
-
-You should see an option to enable Phone Signup:
-
-
-
-Toggle it on, and copy the 3 values over from the twilio dashboard. Click save.
-
-Note: for "Twilio Message Service SID" you can use the Sender Phone Number generated above.
-
-
-
-Now the backend should be setup, we can proceed to add our client-side code!
-
-#### SMS custom template
-
-The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
-
-Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
-
-Use the variable `.Code` in the template to display the OTP code. Here's an example in the SMS template.
-
-
-
-### Using OTP with password based logins
-
-In this scenario we'll be using the user's mobile phone number and a corresponding password as an alternative to signing up with an email address. Note: please thoroughly consider potential security implications when signing up with a combination of phone number and password. Phone numbers are sometimes recycled by phone networks when users cancel their phone contracts or move countries, thereby granting access to the user's account to the subsequent owner of the phone number. In the near future Supabase will support multifactor authentication, which will mitigate this risk, but for now you may want to consider allowing your users to recover their account by some other means in an emergency.
-
-Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signUp({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555",
- "password": "some-password"
-}'
-```
-
-
-
-
-The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
-
-You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '+13334445555',
- token: '123456',
- type: 'sms',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "+13334445555",
- "token": "123456"
-}'
-```
-
-
-
-
-If successful the user will now be logged in and you should receive a valid session like:
-
-```json
-{
- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
-}
-```
-
-The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
-
-Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithPassword({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555",
- "password": "some-password"
-}'
-```
-
-
-
-
-### Using OTP as a passwordless sign-in mechanism
-
-In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
-
-In javascript we can use the `signIn` method with a single parameter: `phone`
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithOtp({
- phone: '+13334445555',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "+13334445555"
-}'
-```
-
-
-
-
-The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '+13334445555',
- token: '123456',
- type: 'sms',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "+13334445555",
- "token": "123456"
-}'
-```
-
-
-
-
-and the response should also be the same as above:
-
-```json
-{
- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
-}
-```
-
-The user does not have a password therefore will need to sign in via this method each time they want to access your service.
-
-## Resources
-
-- [Twilio Signup](https://www.twilio.com/try-twilio)
-- [Supabase Dashboard](https://app.supabase.com)
-- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-twitch.mdx b/apps/docs/pages/guides/auth/auth-twitch.mdx
deleted file mode 100644
index fab1f8e42e3..00000000000
--- a/apps/docs/pages/guides/auth/auth-twitch.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-twitch',
- title: 'Login with Twitch',
- description: 'Add Twitch OAuth to your Supabase project',
-}
-
-To enable Twitch Auth for your project, you need to set up a Twitch Application and add the Application OAuth credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Twitch logins for your application consists of 3 parts:
-
-- Create and configure a Twitch Application [Twitch Developer Console](https://dev.twitch.tv/console)
-- Add your Twitch OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Twitch Developer account
-
-- Go to [dev.twitch.tv](https://dev.twitch.tv).
-- Click on `Log in with Twitch` at the top right to log in.
-- If you have not already enabled 2-Factor Authentication for your Twitch Account, you will need to do that at [Twitch Security Settings](https://www.twitch.tv/settings/security) before you can continue.
-
-
-
-- Once logged in, go to the [Twitch Developer Console](https://dev.twitch.tv/console).
-
-
-
-## Find your callback URL
-
-In the next step you require a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Twitch Application
-
-
-
-- Click on `+ Register Your Application` at the top right.
-
-
-
-- Enter the name of your application.
-- Type or paste your `OAuth Redirect URL` (the callback URL from the previous step.)
-- Select a category for your app.
-- Check the Captcha box and click `Create`.
-
-## Retrieve your Twitch OAuth Client ID and Client Secret
-
-- Click `Manage` at the right of your application entry in the list.
-
-
-
-- Copy your Client ID.
-- Click `New Secret` to create a new Client Secret.
-- Copy your Client Secret.
-
-
-
-## Add your Twitch credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Twitch Enabled` to ON
-- Enter your `client_id` and `client_secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `twitch` as the `provider`:
-
-```js
-async function signInWithTwitch() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'twitch',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Twitch Account](https://twitch.tv)
-- [Twitch Developer Console](https://dev.twitch.tv/console)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-twitter.mdx b/apps/docs/pages/guides/auth/auth-twitter.mdx
deleted file mode 100644
index 40cf31af0da..00000000000
--- a/apps/docs/pages/guides/auth/auth-twitter.mdx
+++ /dev/null
@@ -1,100 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-twitter',
- title: 'Login with Twitter',
- description: 'Add Twitter OAuth to your Supabase project',
-}
-
-To enable Twitter Auth for your project, you need to set up a Twitter OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Twitter logins for your application consists of 3 parts:
-
-- Create and configure a Twitter Project and App on the [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard).
-- Add your Twitter `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
-
-## Access your Twitter Developer account
-
-- Go to [developer.twitter.com](https://developer.twitter.com).
-- Click on `Sign in` at the top right to log in.
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Twitter OAuth app
-
-- Click `+ Create Project`.
- - Enter your project name, click `Next`.
- - Select your use case, click `Next`.
- - Enter a description for your project, click `Next`.
- - Enter a name for your app, click `Complete`.
- - Copy and save your `API Key` (this is your `client_id`).
- - Copy and save your `API Secret Key` (this is your `client_secret`).
-- At the bottom, under `Next, setup your App` click the link `enable 3rd party authentication`.
-- Under `App Settings`, click on the gear icon next to your app name to go to `App Settings`.
-- At the bottom, next to `Authentication settings`, click `Edit`.
-- Turn `Enable 3-legged OAuth` ON.
-- Turn `Request email address from users` ON.
-- Enter your `Callback URL`.
-- Enter your `Website URL`.
-- Enter your `Terms of service URL`.
-- Enter your `Privacy policy URL`.
-- Click `Save`.
-
-## Enter your Twitter credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- In the left sidebar, click the `Authentication` icon (near the top).
-- Click `Settings` from the list to go to the `Authentication Settings` page.
-- Enter the final (hosted) URL of your app under `Site URL` (this is important).
-- Under `External OAuth Providers` turn `Twitter Enabled` to ON.
-- Enter your `API Key` (`client_id`) and `API Secret Key` (`client_secret`) saved in the previous step.
-- Click `Save`.
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `twitter` as the `provider`:
-
-```js
-async function signInWithTwitter() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'twitter',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-vonage.mdx b/apps/docs/pages/guides/auth/auth-vonage.mdx
deleted file mode 100644
index 5ebe1de41d0..00000000000
--- a/apps/docs/pages/guides/auth/auth-vonage.mdx
+++ /dev/null
@@ -1,277 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-vonage',
- title: 'Phone Auth with Vonage',
- description: 'How to set up and use Mobile OTP with Vonage and Supabase.',
-}
-
-## Overview
-
-In this guide we'll show you how to authenticate your users with SMS based OTP (One-Time Password) tokens.
-
-There are two reasons to use Supabase SMS OTP tokens:
-
-- You want users to log in with mobile + password, and the mobile should be verified via SMS
-- You want users to log in with mobile ONLY (i.e. passwordless login)
-
-We'll cover:
-
-- [Getting your Vonage API Key](#finding-your-vonage-api-key)
-- [Using OTP with password based logins](#using-otp-with-password-based-logins)
-- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
-
-What you'll need:
-
-- A Vonage account (sign up here: https://dashboard.nexmo.com/sign-up)
-- A Supabase project (create one here: https://app.supabase.com)
-- A mobile phone capable of receiving SMS
-
-## Steps
-
-### Getting your Vonage credentials
-
-Start by logging into your Vonage Dashboard at https://dashboard.nexmo.com/
-
-You will see you API Key and API Secret here, which is actually all you need to get started.
-
-In most countries, a phone number is actually optional and you can also use any Alphanumeric Sender ID of up to 11 characters length (8 for India) as a Sender ID (from). This means you do not need a number to test with in most cases.
-
-To find out more about supported countries for Alphanumeric Sender ID, check this overview: https://help.nexmo.com/hc/en-us/articles/115011781468-SMS-Features-Overview-Outbound-only-
-
-Hint: Some countries might need a Sender ID Registration to allow sending with an Alphanumeric Sender ID. You can find this information in the help article as well. If Alpha Sender IDs are not supported, you will need to buy a phone number.
-
-### Getting a phone number (optional)
-
-If you want a phone number to send SMS from, you can buy one from the Vonage Dashboard under Numbers > Buy Numbers (https://dashboard.nexmo.com/buy-numbers).
-
-Select the country you want a number for. You will need a mobile phone number with SMS or SMS+Voice capability. After you have bought the number, you will be able to send SMS from it.
-
-### Configure Supabase
-
-Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
-
-You should see an option to enable Phone Signup.
-
-Toggle it on, and copy the api key, api secret and optionally phone number values over from the Vonage dashboard. Click save.
-
-Now the backend should be setup, we can proceed to add our client-side code!
-
-#### SMS custom template
-
-The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
-
-Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
-
-Use the variable `.Code` in the template to display the code.
-
-### Using OTP with password based logins
-
-In this use scenario we'll be using the user's mobile phone number as an alternative to an email address when signing up along with a password. You may want to think hard about the permanency of this however. It is not uncommon for mobile phone numbers to be recycled by phone networks when users cancel their phone contracts or move countries, therefore granting access to the user's account to whoever takes over the phone number in the future.
-
-Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signUp({
- phone: '491512223334444',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://xxx.supabase.co/auth/v1/signup' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "491512223334444",
- "password": "some-password"
-}'
-```
-
-
-
-
-The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
-
-You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '491512223334444',
- token: '123456',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "491512223334444",
- "token": "123456"
-}'
-```
-
-
-
-
-If successful the user will now be logged in and you should receive a valid session like:
-
-```json
-{
- "access_token": "eyJxxx...",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "yyy..."
-}
-```
-
-The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
-
-Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithPassword({
- phone: '491512223334444',
- password: 'some-password',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://xxx.supabase.co/auth/v1/token?grant_type=password' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "491512223334444",
- "password": "some-password"
-}'
-```
-
-
-
-
-### Using OTP as a passwordless sign-in mechanism
-
-In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
-
-In javascript we can use the `signIn` method with a single parameter: `phone`
-
-
-
-
-```js
-let { user, error } = await supabase.auth.signInWithOtp({
- phone: '491512223334444',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://xxx.supabase.co/auth/v1/otp' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "phone": "491512223334444"
-}'
-```
-
-
-
-
-The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
-
-
-
-
-```js
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '491512223334444',
- token: '123456',
-})
-```
-
-
-
-
-```bash
-curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
--H "apikey: SUPABASE_KEY" \
--H "Content-Type: application/json" \
--d '{
- "type": "sms",
- "phone": "491512223334444",
- "token": "123456"
-}'
-```
-
-
-
-
-and the response should also be the same as above:
-
-```json
-{
- "access_token": "eyJxxx...",
- "token_type": "bearer",
- "expires_in": 3600,
- "refresh_token": "yyy..."
-}
-```
-
-The user does not have a password therefore will need to sign in via this method each time they want to access your service.
-
-## Resources
-
-- [Vonage Signup](https://dashboard.nexmo.com/sign-up)
-- [Supabase Dashboard](https://app.supabase.com)
-- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-workos.mdx b/apps/docs/pages/guides/auth/auth-workos.mdx
deleted file mode 100644
index 806a838207a..00000000000
--- a/apps/docs/pages/guides/auth/auth-workos.mdx
+++ /dev/null
@@ -1,93 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-workos',
- title: 'Login with WorkOS',
- description: 'Add WorkOS OAuth to your Supabase project',
-}
-
-To enable WorkOS Auth for your project, you need to set up WorkOS OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-In this guide, we will cover how to use Supabase OAuth with WorkOS to implement Single-Sign-On(SSO).
-
-The procedure consists of five broad steps:
-
-- Create a new organization from your WorkOS Dashboard.
-- Obtain the `Client ID` from the Configuration tab and configure redirect URI.
-- Obtain the `WorkOS Secret` from the credentials tab.
-- Connect a WorkOS Supported Identity Provider
-- Add your WorkOS credentials into your Supabase project
-
-## Create a WorkOS Organization
-
-Log in to the dashboard and hop over to the Organizations tab to create and organization
-
-
-## Obtain the Client ID and configure Redirect URI
-
-Head over to the Configuration tab and configure the redirect URI.The redirect URI should look like `https://.supabase.co/auth/v1/callback`
-Note that this is distinct from the redirect URI referred to in the Supabase dashboard
-
-
-
-## Obtain the WorkOS Secret
-
-Head over to the API Keys page and obtain the secret key.
-
-
-
-## Connect a WorkOS Supported Identity Provider
-
-Set up the identity provider by visiting the setup link.
-
-
-
-You can pick between any one of the many identity providers that WorkOS supports.
-
-## Add your WorkOS credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Under `External OAuth Providers` turn `WorkOS Enabled` to ON
-- Enter the `Client ID`, `Secret`, and `WorkOS URL` saved in the previous steps. The ``WorkOS URL` setting should be set to https://api.workos.com/
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `workos` as the `provider`:
-
-```js
-async function signInWithWorkOS() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'workos',
- options: {
- queryParams: {
- connection: '',
- organization: '',
- },
- },
- })
-}
-```
-
-Refer to the [WorkOS Documentation](https://workos.com/docs/reference/sso/authorize/) to learn more about the different methods.
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [WorkOS Documentation](https://workos.com/docs/sso/guide)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/auth-zoom.mdx b/apps/docs/pages/guides/auth/auth-zoom.mdx
deleted file mode 100644
index 13d9de860c5..00000000000
--- a/apps/docs/pages/guides/auth/auth-zoom.mdx
+++ /dev/null
@@ -1,100 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'auth-zoom',
- title: 'Login with Zoom',
- description: 'Add Zoom OAuth to your Supabase project',
-}
-
-To enable Zoom Auth for your project, you need to set up a Zoom OAuth application and add the application credentials to your Supabase Dashboard.
-
-## Overview
-
-Setting up Zoom logins for your application consists of 3 parts:
-
-- Create and configure a Zoom OAuth App on [Zoom App Marketplace](https://marketplace.zoom.us/)
-- Add your Zoom OAuth keys to your [Supabase Project](https://app.supabase.com)
-- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
-
-## Access your Zoom Developer account
-
-- Go to [marketplace.zoom.us](https://marketplace.zoom.us/).
-- Click on `Sign In` at the top right to log in.
-
-
-
-## Find your callback URL
-
-The next step requires a callback URL, which looks like this:
-
-`https://.supabase.co/auth/v1/callback`
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com).
-- Click on the `Settings` icon at the bottom of the left sidebar.
-- Click on `API` in the list.
-- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
-- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
-
-
-
-## Create a Zoom Oauth App
-
-- Go to [marketplace.zoom.us](https://marketplace.zoom.us/).
-- Click on `Sign In` at the top right to log in.
-- Click `Build App` (from the dropdown Develop)
-- In the OAuth card, click `Create`
-- Type the name of your app
-- Choose app type
-- Click `Create`
-
-Under `App credentials`
-
-- Copy and save your `Client ID`.
-- Copy and save your `Client secret`.
-
-Under `Redirect URL for OAuth`
-
-- Paste your `Callback URL`
-- Click `Continue`
-
-## Enter your Zoom credentials into your Supabase Project
-
-- Go to your [Supabase Project Dashboard](https://app.supabase.com)
-- In the left sidebar, click the `Authentication` icon (near the top)
-- Click `Settings` from the list to go to the `Authentication Settings` page
-- Enter the final (hosted) URL of your app under `Site URL` (this is important)
-- Under `External OAuth Providers` turn `Zoom Enabled` to ON
-- Enter your `Zoom Client ID` and `Zoom Client Secret` saved in the previous step
-- Click `Save`
-
-## Add login code to your client app
-
-When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `zoom` as the `provider`:
-
-```js
-async function signInWithZoom() {
- const { data, error } = await supabase.auth.signInWithOAuth({
- provider: 'zoom',
- })
-}
-```
-
-When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
-
-```js
-async function signout() {
- const { error } = await supabase.auth.signOut()
-}
-```
-
-## Resources
-
-- [Supabase Account - Free Tier OK](https://supabase.com)
-- [Supabase JS Client](https://github.com/supabase/supabase-js)
-- [Zoom App Marketplace](https://marketplace.zoom.us/)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/overview.mdx b/apps/docs/pages/guides/auth/overview.mdx
index 210374ebf3c..85b1fdc96da 100644
--- a/apps/docs/pages/guides/auth/overview.mdx
+++ b/apps/docs/pages/guides/auth/overview.mdx
@@ -1,5 +1,6 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import OldContent from '~/pages/guides/auth.mdx'
+import NewContent from '~/pages/new/auth.mdx'
+import { useRouter } from 'next/router'
export const meta = {
id: 'auth',
@@ -8,9 +9,175 @@ export const meta = {
sidebar_label: 'Overview',
}
+## Overview
+
+There are two parts to every Auth system:
+
+- **Authentication:** should this person be allowed in? If yes, who are they?
+- **Authorization:** once they are in, what are they allowed to do?
+
+Supabase Auth is designed to work either as a standalone product, or deeply integrated with the other Supabase products.
+Postgres is at the heart of everything we do, and the Auth system follows this principle. We leverage Postgres' built-in Auth functionality wherever possible.
+
+Here's a quick, 2 minute tour of the Auth features built-in to Supabase:
+
+
+
+
+
+## Authentication
+
+You can authenticate your users in several ways:
+
+- Email & password.
+- Magic links (one-click logins).
+- Social providers.
+- Phone logins.
+
+### Providers
+
+We provide a suite of Providers and login methods, as well as [Auth helpers](/docs/guides/auth/auth-helpers/).
+
+
+
+
+
+### Configure third-party providers
+
+You can enable third-party providers with the click of a button by navigating to Authentication > Settings > Auth Providers and inputting your `Client ID` and `Secret` for each.
+
+
+
+### Redirect URLs and wildcards
+
+When using third-party providers, the [Supabase client library](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect) redirects the user to the provider. When the third-party provider successfully authenticates the user, the provider redirects the user to the Supabase Auth callback URL where they are further redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or [add additional redirect URLs](https://app.supabase.com/project/_/auth/settings).
+
+You can use wildcard match patterns to support preview URLs from providers like Netlify and Vercel. See the [full list of supported patterns](https://pkg.go.dev/github.com/gobwas/glob#Compile). Use [this tool](https://www.digitalocean.com/community/tools/glob?comments=true&glob=http%3A%2F%2Flocalhost%3A3000%2F%2A%2A&matches=false&tests=http%3A%2F%2Flocalhost%3A3000&tests=http%3A%2F%2Flocalhost%3A3000%2F&tests=http%3A%2F%2Flocalhost%3A3000%2F%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest-test%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest%2Ftest%3Ftest%3Dtest) to test your patterns.
+
+> ⚠️ WARNING: While the "globstar" (`**`) is useful for local development and preview URLs, we recommend setting the exact redirect URL path for your site URL in production.
+
+#### Netlify preview URLs
+
+For deployments with Netlify, set the `SITE_URL` to your official site URL. Add the following additional redirect URLs for local development and deployment previews:
+
+- `http://localhost:3000/**`
+- `https://**--my_org.netlify.app/**`
+
+#### Vercel preview URLs
+
+For deployments with Vercel, set the `SITE_URL` to your official site URL. Add the following additional redirect URLs for local development and deployment previews:
+
+- `http://localhost:3000/**`
+- `https://*-username.vercel.app/**`
+
+Vercel provides an environment variable for the URL of the deployment called `NEXT_PUBLIC_VERCEL_URL`. See the [Vercel docs](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) for more details. You can use this variable to dynamically redirect depending on the environment:
+
+```js
+const getURL = () => {
+ let url =
+ process?.env?.NEXT_PUBLIC_SITE_URL ?? // Set this to your site URL in production env.
+ process?.env?.NEXT_PUBLIC_VERCEL_URL ?? // Automatically set by Vercel.
+ 'http://localhost:3000/';
+ // Make sure to include `https://` when not localhost.
+ url = url.includes('http') ? url : `https://${url}`;
+ // Make sure to including trailing `/`.
+ url = url.charAt(url.length - 1) === '/' ? url : `${url}/`;
+ return url;
+};
+
+const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'github'
+ options: {
+ redirectTo: getURL()
+ }
+}
+```
+
+#### Mobile deep linking URIs
+
+For mobile applications you can use deep linking URIs. For example for your `SITE_URL` you can specify something like `com.supabase://login-callback/` and for additional redirect URLs something like `com.supabase.staging://login-callback/` if needed.
+
+## Authorization
+
+When you need granular authorization rules, nothing beats PostgreSQL's Row Level Security (RLS).
+
+Policies are PostgreSQL's rule engine. They are incredibly powerful and flexible, allowing you to write complex SQL rules which fit your unique business needs.
+
+Get started with our [Row Level Security Guides](/docs/guides/auth/row-level-security).
+
+### Row Level Security
+
+Authentication only gets you so far. When you need granular authorization rules, nothing beats PostgreSQL's [Row Level Security (RLS)](https://www.postgresql.org/docs/current/ddl-rowsecurity.html). Supabase makes it simple to turn RLS on and off.
+
+
+
+### Policies
+
+[Policies](https://www.postgresql.org/docs/current/sql-createpolicy.html) are PostgreSQL's rule engine. They are incredibly powerful and flexible, allowing you to write complex SQL rules which fit your unique business needs.
+
+
+
+With policies, your database becomes the rules engine. Instead of repetitively filtering your queries, like this ...
+
+```js
+const loggedInUserId = 'd0714948'
+let { data, error } = await supabase
+ .from('users')
+ .select('user_id, name')
+ .eq('user_id', loggedInUserId)
+
+// console.log(data)
+// => { id: 'd0714948', name: 'Jane' }
+```
+
+... you can simply define a rule on your database table, `auth.uid() = user_id`, and your request will return the rows which pass the rule, even when you remove the filter from your middleware:
+
+```js
+let { data, error } = await supabase.from('users').select('user_id, name')
+
+// console.log(data)
+// Still => { id: 'd0714948', name: 'Jane' }
+```
+
+### How It Works
+
+1. A user signs up. Supabase creates a new user in the `auth.users` table.
+2. Supabase returns a new JWT, which contains the user's `UUID`.
+3. Every request to your database also sends the JWT.
+4. Postgres inspects the JWT to determine the user making the request.
+5. The user's UID can be used in policies to restrict access to rows.
+
+Supabase provides a special function in Postgres, `auth.uid()`, which extracts the user's UID from the JWT. This is especially useful when creating policies.
+
+## User Management
+
+Supabase provides multiple endpoints to authenticate and manage your users:
+
+- [Sign up](/docs/reference/javascript/auth-signup)
+- [Sign in with password](/docs/reference/javascript/auth-signinwithpassword)
+- [Sign in with passwordless / one-time password (OTP)](/docs/reference/javascript/auth-signinwithotp)
+- [Sign in with OAuth](/docs/reference/javascript/auth-signinwithoauth)
+- [Sign out](/docs/reference/javascript/auth-signout)
+
+When users sign up, Supabase assigns them a unique ID. You can reference this ID anywhere in your database. For example, you might create a `profiles` table referencing `id` in the `auth.users` table using a `user_id` field.
+
+
+
export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return OldContent()
+ const router = useRouter()
+ if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true' && !router.asPath.includes('overview')) {
+ return NewContent()
}
return
}
diff --git a/apps/docs/pages/guides/auth/passwordless-login/email-otp-magic-link.mdx b/apps/docs/pages/guides/auth/passwordless-login/email-otp-magic-link.mdx
index 8e6bb09d58e..da78296f4ba 100644
--- a/apps/docs/pages/guides/auth/passwordless-login/email-otp-magic-link.mdx
+++ b/apps/docs/pages/guides/auth/passwordless-login/email-otp-magic-link.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-magic-link.mdx'
export const meta = {
id: 'auth-magic-link',
@@ -7,11 +6,94 @@ export const meta = {
description: 'Use Supabase to authenticate and authorize your users using magic links.',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+Magic links are a form of passwordless logins where users click on a link sent to their email address to log in to their accounts.
+Magic links only work with email addresses. By default, a user can only request a magic link once every 60 seconds.
+
+## Overview
+
+Setting up Magic Link logins for your Supabase application.
+
+- Add Magic Link authenticator to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your application - [JavaScript](https://github.com/supabase/supabase-js) | [Flutter](https://github.com/supabase/supabase-flutter)
+
+## Add Magic Link into your Supabase Project
+
+1. For [Site URL](https://app.supabase.com/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
+1. For [Auth Providers](https://app.supabase.com/project/_/auth/providers), **enable email provider**.
+
+## Add login code to your client app
+
+
+
+
+When your user signs in, call [signInWithOtp()](/docs/reference/javascript/auth-signinwithotp) with their email address:
+
+```js
+async function signInWithEmail() {
+ const { data, error } = await supabase.auth.signInWithOtp({
+ email: 'example@email.com',
+ options: {
+ emailRedirectTo: 'https://example.com/welcome',
+ },
+ })
}
+```
+
+
+
+
+When your user signs in, call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:
+
+```dart
+Future signInWithEmail() async {
+ final AuthResponse res = await supabase.auth.signinwithotp(email: 'example@email.com');
+}
+```
+
+
+
+
+
+
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signOut() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+
+
+
+When your user signs out, call [signOut()](/docs/reference/dart/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```dart
+Future signOut() async {
+ await supabase.auth.signOut();
+}
+```
+
+
+
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Supabase Flutter Client](https://github.com/supabase/supabase-flutter)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-messagebird.mdx b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-messagebird.mdx
index 93e300fd59b..38651a9876d 100644
--- a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-messagebird.mdx
+++ b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-messagebird.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-messagebird.mdx'
export const meta = {
id: 'auth-messagebird',
@@ -7,11 +6,279 @@ export const meta = {
description: 'How to set up and use Mobile OTP with MessageBird and Supabase.',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+## Overview
+
+In this guide we'll show you how to authenticate your users with SMS based OTP (One-Time Password) tokens.
+
+There are two reasons to use Supabase SMS OTP tokens:
+
+- You want users to log in with mobile + password, and the mobile should be verified via SMS
+- You want users to log in with mobile ONLY (i.e. passwordless login)
+
+We'll cover:
+
+- [Finding your MessageBird credentials](#finding-your-messagebird-credentials)
+- [Using OTP with password based logins](#using-otp-with-password-based-logins)
+- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
+
+What you'll need:
+
+- A MessageBird account (sign up here: https://dashboard.messagebird.com/en/sign-up)
+- A Supabase project (create one here: https://app.supabase.com)
+- A mobile phone capable of receiving SMS
+
+## Steps
+
+### Finding your MessageBird credentials
+
+Start by logging into your MessageBird account and verify the mobile number you'll be using to test with: https://dashboard.messagebird.com/en/getting-started/sms
+
+This is the number that will be receiving the SMS OTPs.
+
+
+
+
+
+Navigate to the [dashboard settings](https://dashboard.messagebird.com/en/settings/sms) to set the default originator. The messagebird originator is the name or number from which the message is sent.
+For more information, you can refer to the messagebird article on choosing an originator [here](https://support.messagebird.com/hc/en-us/articles/115002628665-Choosing-an-originator)
+
+
+
+You will need the following values to get started:
+
+- Live API Key / Test API Key
+- MessageBird originator
+
+Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
+
+You should see an option to enable Phone Signup.
+
+
+
+Toggle it on, and copy the 2 values over from the messagebird dashboard. Click save.
+
+Note: If you use the Test API Key, the OTP will not be delivered to the mobile number specified but messagebird will log the response in the dashboard.
+If the Live API Key is used instead, the OTP will be delivered and there will be a deduction in your free credits.
+
+Plugin MessageBird credentials
+
+Now the backend should be setup, we can proceed to add our client-side code!
+
+#### SMS custom template
+
+The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
+
+Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
+
+Use the variable `.Code` in the template to display the code.
+
+### Using OTP with password based logins
+
+In this use scenario we'll be using the user's mobile phone number as an alternative to an email address when signing up along with a password. You may want to think hard about the permanency of this however. It is not uncommon for mobile phone numbers to be recycled by phone networks when users cancel their phone contracts or move countries, therefore granting access to the user's account to whoever takes over the phone number in the future. Soon we'll add multi-factor auth, which will mitigate this risk, but for now you may want to give some thought to allowing your users to recover their account by some other means in an emergency.
+
+Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signUp({
+ phone: '+13334445555',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555",
+ "password": "some-password"
+}'
+```
+
+
+
+
+The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '+13334445555',
+ token: '123456',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "+13334445555",
+ "token": "123456"
+}'
+```
+
+
+
+
+If successful the user will now be logged in and you should receive a valid session like:
+
+```json
+{
+ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
}
+```
+
+The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
+
+Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithPassword({
+ phone: '+13334445555',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555",
+ "password": "some-password"
+}'
+```
+
+
+
+
+### Using OTP as a passwordless sign-in mechanism
+
+In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
+
+In javascript we can use the `signIn` method with a single parameter: `phone`
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithOtp({
+ phone: '+13334445555',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555"
+}'
+```
+
+
+
+
+The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '+13334445555',
+ token: '123456',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "+13334445555",
+ "token": "123456"
+}'
+```
+
+
+
+
+and the response should also be the same as above:
+
+```json
+{
+ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
+}
+```
+
+The user does not have a password therefore will need to sign in via this method each time they want to access your service.
+
+## Resources
+
+- [MessageBird Signup](https://dashboard.messagebird.com/en/sign-up)
+- [Supabase Dashboard](https://app.supabase.com)
+- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-twilio.mdx b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-twilio.mdx
index 922d4a33db1..fa45a547970 100644
--- a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-twilio.mdx
+++ b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-twilio.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-twilio.mdx'
export const meta = {
id: 'auth-twilio',
@@ -7,11 +6,300 @@ export const meta = {
description: 'How to set up and use Mobile OTP with Twilio and Supabase.',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+## Overview
+
+In this guide we'll show you how to authenticate your users with SMS based One-Time Password (OTP) tokens.
+
+There are two reasons to use Supabase SMS OTP tokens:
+
+- You want users to log in with mobile number + password, and the mobile number should be verified via SMS
+- You want users to log in with mobile number ONLY (i.e. passwordless login)
+
+We'll cover:
+
+- [Finding your Twilio credentials](#finding-your-twilio-credentials)
+- [Using OTP with password based logins](#using-otp-with-password-based-logins)
+- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
+
+What you'll need:
+
+- A Twilio account (sign up here: https://www.twilio.com/try-twilio)
+- A Supabase project (create one here: https://app.supabase.com)
+- A mobile phone capable of receiving SMS
+
+## Video
+
+
+
+
+
+## Steps
+
+### Finding your Twilio credentials
+
+Start by logging into your Twilio account and starting a new project: https://www.twilio.com/console/projects/create
+
+Give your project a name and verify the mobile number you'll be using to test with. This is the number that will be receiving the SMS OTPs.
+
+
+
+
+Select 'SMS', 'Identity & Verification', and 'With code' as options on the welcome form.
+
+
+
+When you're back on the [Twilio console screen](https://www.twilio.com/console), you need to scroll down and click 'Get a trial phone number' - this is the number that you'll be sending SMSs from.
+
+
+
+
+
+You should now be able to see all three values you'll need to get started:
+
+- Account SID
+- Auth Token
+- Sender Phone Number
+
+
+
+Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
+
+You should see an option to enable Phone Signup:
+
+
+
+Toggle it on, and copy the 3 values over from the twilio dashboard. Click save.
+
+Note: for "Twilio Message Service SID" you can use the Sender Phone Number generated above.
+
+
+
+Now the backend should be setup, we can proceed to add our client-side code!
+
+#### SMS custom template
+
+The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
+
+Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
+
+Use the variable `.Code` in the template to display the OTP code. Here's an example in the SMS template.
+
+
+
+### Using OTP with password based logins
+
+In this scenario we'll be using the user's mobile phone number and a corresponding password as an alternative to signing up with an email address. Note: please thoroughly consider potential security implications when signing up with a combination of phone number and password. Phone numbers are sometimes recycled by phone networks when users cancel their phone contracts or move countries, thereby granting access to the user's account to the subsequent owner of the phone number. In the near future Supabase will support multifactor authentication, which will mitigate this risk, but for now you may want to consider allowing your users to recover their account by some other means in an emergency.
+
+Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signUp({
+ phone: '+13334445555',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555",
+ "password": "some-password"
+}'
+```
+
+
+
+
+The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '+13334445555',
+ token: '123456',
+ type: 'sms',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "+13334445555",
+ "token": "123456"
+}'
+```
+
+
+
+
+If successful the user will now be logged in and you should receive a valid session like:
+
+```json
+{
+ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
}
+```
+
+The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
+
+Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithPassword({
+ phone: '+13334445555',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555",
+ "password": "some-password"
+}'
+```
+
+
+
+
+### Using OTP as a passwordless sign-in mechanism
+
+In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
+
+In javascript we can use the `signIn` method with a single parameter: `phone`
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithOtp({
+ phone: '+13334445555',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "+13334445555"
+}'
+```
+
+
+
+
+The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '+13334445555',
+ token: '123456',
+ type: 'sms',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "+13334445555",
+ "token": "123456"
+}'
+```
+
+
+
+
+and the response should also be the same as above:
+
+```json
+{
+ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI3MjkxNTc3LCJzdWIiOiJmYTA2NTQ1Zi1kYmI1LTQxY2EtYjk1NC1kOGUyOTg4YzcxOTEiLCJlbWFpbCI6IiIsInBob25lIjoiNjU4NzUyMjAyOSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6InBob25lIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.1BqRi0NbS_yr1f6hnr4q3s1ylMR3c1vkiJ4e_N55dhM",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "LSp8LglPPvf0DxGMSj-vaQ"
+}
+```
+
+The user does not have a password therefore will need to sign in via this method each time they want to access your service.
+
+## Resources
+
+- [Twilio Signup](https://www.twilio.com/try-twilio)
+- [Supabase Dashboard](https://app.supabase.com)
+- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-vonage.mdx b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-vonage.mdx
index deec90db1d5..5ebe1de41d0 100644
--- a/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-vonage.mdx
+++ b/apps/docs/pages/guides/auth/passwordless-login/phone-sms-otp-vonage.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-vonage.mdx'
export const meta = {
id: 'auth-vonage',
@@ -7,11 +6,272 @@ export const meta = {
description: 'How to set up and use Mobile OTP with Vonage and Supabase.',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+## Overview
+
+In this guide we'll show you how to authenticate your users with SMS based OTP (One-Time Password) tokens.
+
+There are two reasons to use Supabase SMS OTP tokens:
+
+- You want users to log in with mobile + password, and the mobile should be verified via SMS
+- You want users to log in with mobile ONLY (i.e. passwordless login)
+
+We'll cover:
+
+- [Getting your Vonage API Key](#finding-your-vonage-api-key)
+- [Using OTP with password based logins](#using-otp-with-password-based-logins)
+- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism)
+
+What you'll need:
+
+- A Vonage account (sign up here: https://dashboard.nexmo.com/sign-up)
+- A Supabase project (create one here: https://app.supabase.com)
+- A mobile phone capable of receiving SMS
+
+## Steps
+
+### Getting your Vonage credentials
+
+Start by logging into your Vonage Dashboard at https://dashboard.nexmo.com/
+
+You will see you API Key and API Secret here, which is actually all you need to get started.
+
+In most countries, a phone number is actually optional and you can also use any Alphanumeric Sender ID of up to 11 characters length (8 for India) as a Sender ID (from). This means you do not need a number to test with in most cases.
+
+To find out more about supported countries for Alphanumeric Sender ID, check this overview: https://help.nexmo.com/hc/en-us/articles/115011781468-SMS-Features-Overview-Outbound-only-
+
+Hint: Some countries might need a Sender ID Registration to allow sending with an Alphanumeric Sender ID. You can find this information in the help article as well. If Alpha Sender IDs are not supported, you will need to buy a phone number.
+
+### Getting a phone number (optional)
+
+If you want a phone number to send SMS from, you can buy one from the Vonage Dashboard under Numbers > Buy Numbers (https://dashboard.nexmo.com/buy-numbers).
+
+Select the country you want a number for. You will need a mobile phone number with SMS or SMS+Voice capability. After you have bought the number, you will be able to send SMS from it.
+
+### Configure Supabase
+
+Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
+
+You should see an option to enable Phone Signup.
+
+Toggle it on, and copy the api key, api secret and optionally phone number values over from the Vonage dashboard. Click save.
+
+Now the backend should be setup, we can proceed to add our client-side code!
+
+#### SMS custom template
+
+The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
+
+Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
+
+Use the variable `.Code` in the template to display the code.
+
+### Using OTP with password based logins
+
+In this use scenario we'll be using the user's mobile phone number as an alternative to an email address when signing up along with a password. You may want to think hard about the permanency of this however. It is not uncommon for mobile phone numbers to be recycled by phone networks when users cancel their phone contracts or move countries, therefore granting access to the user's account to whoever takes over the phone number in the future.
+
+Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signUp({
+ phone: '491512223334444',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://xxx.supabase.co/auth/v1/signup' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "491512223334444",
+ "password": "some-password"
+}'
+```
+
+
+
+
+The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '491512223334444',
+ token: '123456',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "491512223334444",
+ "token": "123456"
+}'
+```
+
+
+
+
+If successful the user will now be logged in and you should receive a valid session like:
+
+```json
+{
+ "access_token": "eyJxxx...",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "yyy..."
}
+```
+
+The access token can be sent in the Authorization header as a Bearer token for any CRUD operations on supabase-js. See our guide on [Row Level Security](/docs/guides/auth#row-level-security) for more info on restricting access on a user basis.
+
+Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithPassword({
+ phone: '491512223334444',
+ password: 'some-password',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://xxx.supabase.co/auth/v1/token?grant_type=password' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "491512223334444",
+ "password": "some-password"
+}'
+```
+
+
+
+
+### Using OTP as a passwordless sign-in mechanism
+
+In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP.
+
+In javascript we can use the `signIn` method with a single parameter: `phone`
+
+
+
+
+```js
+let { user, error } = await supabase.auth.signInWithOtp({
+ phone: '491512223334444',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://xxx.supabase.co/auth/v1/otp' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "phone": "491512223334444"
+}'
+```
+
+
+
+
+The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
+
+
+
+
+```js
+let { session, error } = await supabase.auth.verifyOTP({
+ phone: '491512223334444',
+ token: '123456',
+})
+```
+
+
+
+
+```bash
+curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
+-H "apikey: SUPABASE_KEY" \
+-H "Content-Type: application/json" \
+-d '{
+ "type": "sms",
+ "phone": "491512223334444",
+ "token": "123456"
+}'
+```
+
+
+
+
+and the response should also be the same as above:
+
+```json
+{
+ "access_token": "eyJxxx...",
+ "token_type": "bearer",
+ "expires_in": 3600,
+ "refresh_token": "yyy..."
+}
+```
+
+The user does not have a password therefore will need to sign in via this method each time they want to access your service.
+
+## Resources
+
+- [Vonage Signup](https://dashboard.nexmo.com/sign-up)
+- [Supabase Dashboard](https://app.supabase.com)
+- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-apple.mdx b/apps/docs/pages/guides/auth/social-login/auth-apple.mdx
index 43257cc81c4..d5bf22f9205 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-apple.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-apple.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-apple.mdx'
export const meta = {
id: 'auth-apple',
@@ -7,11 +6,202 @@ export const meta = {
description: 'Add Apple OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Apple Auth for your project, you need to set up an Apple OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Apple OAuth consists of six broad steps:
+
+- Obtaining an `App Id` with “Sign In with Apple” capabilities.
+- Obtaining a `Services Id` - this will serve as the `client_id`.
+- Obtaining a `secret key` that will be used to get our `client_secret`.
+- Generating the `client_secret` using the `secret key`.
+- Add your `client id` and `client secret` keys to your [Supabase Project](https://app.supabase.com).
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
+
+## Access your Apple Developer account
+
+- Go to [developer.apple.com](https://developer.apple.com).
+- Click on `Account` at the top right to log in.
+
+
+
+## Obtain an App ID
+
+- Go to `Certificates, Identifiers & Profiles`.
+- Click on `Identifiers` at the left.
+- Click on the `+` sign in the upper left next to `Identifiers`.
+- Select `App IDs` and click `Continue`.
+- Select type `App` and click `Continue`.
+- Fill out your app information:
+ - App description.
+ - Bundle ID (Apple recommends reverse-domain name style, so if your domain is acme.com and your app is called roadrunner, use: "com.acme.roadrunner").
+ - Scroll down and check `Sign In With Apple`.
+ - Click `Continue` at the top right.
+ - Click `Register` at the top right.
+
+## Obtain a Services ID
+
+This will serve as the `client_id` when you make API calls to authenticate the user.
+
+- Go to `Certificates, Identifiers & Profiles`.
+- Click on `Identifiers` at the left.
+- Click on the `+` sign in the upper left next to `Identifiers`.
+- Select `Services IDs` and click `Continue`.
+- Fill out your information:
+ - App description.
+ - Bundle ID (you can't use the same Bundle ID from the previous step, but you can just add something to the beginning, such as "app." to make it app.com.acme.roadrunner").
+ - SAVE THIS ID -- this ID will become your `client_id` later.
+ - Click `Continue` at the top right.
+ - Click `Register` at the top right.
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Configure your Services ID
+
+- Under `Identifiers`, click on your newly-created Services ID.
+- Check the box next to `Sign In With Apple` to enable it.
+- Click `Configure` to the right.
+- Make sure your newly created Bundle ID is selected under `Primary App ID`
+- Add your domain to the `Domains and Subdomains` box (do not add `https://`, just add the domain).
+- In the `Return URLs` box, type the callback URL of your app which you found in the previous step and click `Next` at the bottom right.
+- Click `Done` at the bottom.
+- Click `Continue` at the top right.
+- Click `Save` at the top right.
+
+## Download your secret key
+
+Now you'll need to download a `secret key` file from Apple that will be used to generate your `client_secret`.
+
+- Go to `Certificates, Identifiers & Profiles`.
+- Click on `Keys` at the left.
+- Click on the `+` sign in the upper left next to `Keys`.
+- Enter a `Key Name`.
+- Check `Sign In with Apple`.
+- Click `Configure` to the right.
+- Select your newly-created Services ID from the dropdown selector.
+- Click `Save` at the top right.
+- Click `Continue` at the top right.
+- Click `Register` at the top right.
+- Click `Download` at the top right.
+- Save the downloaded file -- this contains your "secret key" that will be used to generate your `client_secret`.
+- Click `Done` at the top right.
+
+## Generate a `client_secret`
+
+The `secret key` you downloaded is used to create the `client_secret` string you'll need to authenticate your users.
+
+According to the [Apple Docs](https://developer.apple.com/documentation/signinwithapplerestapi/generate_and_validate_tokens) it needs to be a JWT
+token encrypted using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm.
+
+At this time, the easiest way to generate this JWT token is with [Ruby](https://www.ruby-lang.org/en/).
+If you don't have Ruby installed, you can [Download Ruby Here](https://www.ruby-lang.org/en/downloads).
+
+- Install Ruby (or check to make sure it's installed on your system).
+- Install [ruby-jwt](https://github.com/jwt/ruby-jwt).
+- From the command line, run: `sudo gem install jwt`.
+
+Create the script below using a text editor: `secret_gen.rb`
+
+```ruby
+require "jwt"
+
+key_file = "Path to the private key"
+team_id = "Your Team ID"
+client_id = "The Service ID of the service you created"
+key_id = "The Key ID of the private key"
+
+validity_period = 180 # In days. Max 180 (6 months) according to Apple docs.
+
+private_key = OpenSSL::PKey::EC.new IO.read key_file
+
+token = JWT.encode(
+ {
+ iss: team_id,
+ iat: Time.now.to_i,
+ exp: Time.now.to_i + 86400 * validity_period,
+ aud: "https://appleid.apple.com",
+ sub: client_id
+ },
+ private_key,
+ "ES256",
+ header_fields=
+ {
+ kid: key_id
+ }
+)
+puts token
+```
+
+1. Edit the `secret_gen.rb` file:
+
+- `key_file` = "Path to the private key you downloaded from Apple". It should look like this: `AuthKey_XXXXXXXXXX.p8`.
+- `team_id` = "Your Team ID". This is found at the top right of the Apple Developer site (next to your name).
+- `client_id` = "The Service ID of the service you created". This is the `Services ID` you created in the above step `Obtain a Services ID`. If you've lost this ID, you can find it in the Apple Developer Site:
+ - Go to `Certificates, Identifiers & Profiles`.
+ - Click `Identifiers` at the left.
+ - At the top right drop-down, select `Services IDs`.
+ - Find your Identifier in the list (i.e. app.com.acme.roadrunner).
+- `key_id` = "The Key ID of the private key". This can be found in the name of your downloaded secret file (For a file named `AuthKey_XXXXXXXXXX.p8` your key_id is `XXXXXXXXXX`). If you've lost this ID, you can find it in the Apple Developer Site:
+ - Go to `Certificates, Identifiers & Profiles`.
+ - Click `Keys` at the left.
+ - Click on your newly-created key in the list.
+ - Look under `Key ID` to find your key_id.
+
+2. From the command line, run: `ruby secret_gen.rb > client_secret.txt`.
+3. Your `client_secret` is now stored in this `client_secret.txt` file.
+
+## Add your OAuth credentials to Supabase
+
+- Go to your [Supabase Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `Apple Enabled` to ON.
+- Enter your `client_id` and `client_secret` saved in the previous steps.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `apple` as the `provider`:
+
+```js
+async function signInWithApple() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'apple',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Apple Developer Account](https://developer.apple.com).
+- [Ruby](https://www.ruby-lang.org/en/) Docs.
+- [ruby-jwt](https://github.com/jwt/ruby-jwt) library.
+- Thanks to [Janak Amarasena](https://medium.com/@janakda) who did all the heavy lifting in [How to configure Sign In with Apple](https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003).
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-azure.mdx b/apps/docs/pages/guides/auth/social-login/auth-azure.mdx
index 09100d4fb3d..d75a365b1d5 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-azure.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-azure.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-azure.mdx'
export const meta = {
id: 'auth-azure',
@@ -7,11 +6,98 @@ export const meta = {
description: 'Add Azure OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Azure Auth for your project, you need to set up an Azure OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Azure OAuth consists of four broad steps:
+
+- Create an application under Azure Active Directory.
+- Obtain a `Application (client) ID` with “Sign In with Azure” capabilities. This will be used as the `client id`.
+- Create a `Secret ID` with “Sign In with Azure” capabilities. The value of the secret will be used as the `client secret`.
+- Add the callback url of your application to the allowlist.
+
+## Access your Azure Developer account
+
+- Go to [portal.azure.com](https://portal.azure.com/#home).
+- Login and select "Azure Active Directory" under the list of Azure Services.
+
+## Register an application
+
+- Under Azure Active Directory, select "App registrations" in the side panel.
+- Select "New registration".
+- Choose a name and select your preferred option for the supported account types.
+- Specify the "Redirect URI".
+- The redirect / callback URI should look like this: `https://.supabase.co/auth/v1/callback`
+- Click "Register" at the bottom of the form.
+
+
+
+## Obtain a Client ID
+
+This will serve as the `client_id` when you make API calls to authenticate the user.
+
+- Once your app has been registered, the client id can be found under the [list of app registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) under the column titled "Application (client) ID".
+
+
+
+## Obtain a Secret ID
+
+This will serve as the `client_secret` when you make API calls to authenticate the user.
+
+- Click on the name of the app registered above.
+- Under "Essentials", click on "Client credentials".
+- Navigate to the "Client secrets" tab and select "New client secret".
+- Enter a description and choose your preferred expiry for the secret.
+- Once the secret is generated, save the `value` (not the secret ID).
+
+
+
+## Obtain the Tenant URL
+
+This will allow your users to use your custom Azure login page when logging in.
+
+- Select the Directory (Tenant) ID value.
+- The Azure Tenant URL should look like this: `https://login.microsoftonline.com/`
+
+
+
+## Add login code to your client app
+
+
+
+Supabase Auth requires that Azure returns a valid email address. Therefore you must request the `email` scope in the `signIn` method above.
+
+
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `azure` as the `provider`:
+
+```js
+async function signInWithAzure() {
+ const { data, error } = await supabase.auth.signInWithOAuth(
+ {
+ provider: 'azure',
+ },
+ {
+ scopes: 'email',
+ }
+ )
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Azure Developer Account](https://portal.azure.com)
+- [GitHub Discussion](https://github.com/supabase/gotrue/pull/54#issuecomment-757043573)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-bitbucket.mdx b/apps/docs/pages/guides/auth/social-login/auth-bitbucket.mdx
index 0d3b621ea44..626b1ef3cf7 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-bitbucket.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-bitbucket.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-bitbucket.mdx'
export const meta = {
id: 'auth-bitbucket',
@@ -7,11 +6,90 @@ export const meta = {
description: 'Add Bitbucket OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Bitbucket Auth for your project, you need to set up a BitBucket OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Bitbucket logins for your application consists of 3 parts:
+
+- Create and configure a Bitbucket OAuth Consumer on [Bitbucket](https://bitbucket.org)
+- Add your Bitbucket OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Bitbucket account
+
+- Go to [bitbucket.org](https://bitbucket.org/).
+- Click on `Login` at the top right to log in.
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Bitbucket OAuth app
+
+- Click on your profile icon at the bottom left
+- Click on `All Workspaces`
+- Select a workspace and click on it to select it
+- Click on `Settings` on the left
+- Click on `OAuth consumers` on the left under `Apps and Features` (near the bottom)
+- Click `Add Consumer` at the top
+- Enter the name of your app under `Name`
+- In `Callback URL`, type the callback URL of your app
+- Check the permissions you need (Email, Read should be enough)
+- Click `Save` at the bottom
+- Click on your app name (the name of your new OAuth Consumer)
+- Copy your `Key` (`client_key`) and `Secret` (`client_secret`) codes
+
+## Add your Bitbucket credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Bitbucket Enabled` to ON
+- Enter your `client_id` and `client_secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `bitbucket` as the `provider`:
+
+```js
+async function signInWithBitbucket() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'bitbucket',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Bitbucket Account](https://bitbucket.org)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-discord.mdx b/apps/docs/pages/guides/auth/social-login/auth-discord.mdx
index 67701ea1187..dc599979d0e 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-discord.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-discord.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-discord.mdx'
export const meta = {
id: 'auth-discord',
@@ -7,11 +6,92 @@ export const meta = {
description: 'Add Discord OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Discord Auth for your project, you need to set up a Discord Application and add the Application OAuth credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Discord logins for your application consists of 3 parts:
+
+- Create and configure a Discord Application [Discord Developer Portal](https://discord.com/developers)
+- Add your Discord OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Discord account
+
+- Go to [discord.com](https://discord.com/).
+- Click on `Login` at the top right to log in.
+
+
+
+- Once logged in, go to [discord.com/developers](https://discord.com/developers).
+
+
+
+## Find your callback URL
+
+In the next step you require a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Discord Application
+
+- Click on `New Application` at the top right.
+- Enter the name of your application and click `Create`.
+- Click on `OAuth2` under `Settings` in the left side panel.
+- Click `Add Redirect` under `Redirects`.
+- Type or paste your `callback URL` into the `Redirects` box.
+- Click `Save Changes` at the bottom.
+- Copy your `Client ID` and `Client Secret` under `Client information`.
+
+## Add your Discord credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Discord Enabled` to ON
+- Enter your `client_id` and `client_secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `discord` as the `provider`:
+
+```js
+async function signInWithDiscord() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'discord',
+ })
}
+```
+
+If your user is already signed in, Discord prompts the user again for authorization.
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Discord Account](https://discord.com)
+- [Discord Developer Portal](https://discord.com/developers)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-facebook.mdx b/apps/docs/pages/guides/auth/social-login/auth-facebook.mdx
index ed30fbca144..43658f38b00 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-facebook.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-facebook.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-facebook.mdx'
export const meta = {
id: 'auth-facebook',
@@ -7,11 +6,107 @@ export const meta = {
description: 'Add Facebook OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Facebook Auth for your project, you need to set up a Facebook OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Facebook logins for your application consists of 3 parts:
+
+- Create and configure a Facebook Application on the [Facebook Developers Site](https://developers.facebook.com)
+- Add your Facebook keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Facebook Developer account
+
+- Go to [developers.facebook.com](https://developers.facebook.com).
+- Click on `Log In` at the top right to log in.
+
+
+
+## Create a Facebook App
+
+- Click on `My Apps` at the top right.
+- Click `Create App` near the top right.
+- Select your app type and click `Continue`.
+- Fill in your app information, then click `Create App`.
+- This should bring you to the screen: `Add Products to Your App`. (Alternatively you can click on `Add Product` in the left sidebar to get to this screen.)
+
+## Find your callback URI
+
+The next step requires a callback URI, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Set up FaceBook Login for your Facebook App
+
+From the `Add Products to your App` screen:
+
+- Click `Setup` under `Facebook Login`
+- Skip the Quickstart screen, instead, in the left sidebar, click `Settings` under `Facebook Login`
+- Enter your callback URI under `Valid OAuth Redirect URIs` on the `Facebook Login Settings` page
+- Enter this in the `Valid OAuth Redirect URIs` box
+- Click `Save Changes` at the bottom right
+
+Be aware that you have to set the right access levels on your Facebook App to enable 3rd party applications to read the email address.
+From the `App Review -> Permissions and Features` screen:
+
+- Click the button `Request Advanced Access` on the right side of `public_profile` and `email`
+
+You can read more about access levels [here](https://developers.facebook.com/docs/graph-api/overview/access-levels/)
+
+## Copy your Facebook App ID and Secret
+
+- Click `Settings / Basic` in the left sidebar
+- Copy your App ID from the top of the `Basic Settings` page
+- Under `App Secret` click `Show` then copy your secret
+- Make sure all required fields are completed on this screen.
+
+## Enter your Facebook App ID and Secret into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Facebook Enabled` to ON
+- Enter your `Facebook client ID` and `Facebook secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `facebook` as the `provider`:
+
+```js
+async function signInWithFacebook() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'facebook',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Facebook Developers Dashboard](https://developers.facebook.com/)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-github.mdx b/apps/docs/pages/guides/auth/social-login/auth-github.mdx
index 3d9de6485f7..6ddcdac1ede 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-github.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-github.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-github.mdx'
export const meta = {
id: 'auth-github',
@@ -7,11 +6,100 @@ export const meta = {
description: 'Add GitHub OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable GitHub Auth for your project, you need to set up a GitHub OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up GitHub logins for your application consists of 3 parts:
+
+- Create and configure a GitHub OAuth App on [GitHub](https://github.com)
+- Add your GitHub OAuth keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your GitHub account
+
+- Go to [github.com](https://github.com).
+- Click on `Sign In` at the top right to log in.
+
+
+
+## Create a GitHub Oauth App
+
+Go to the [GitHub Developer Settings](https://github.com/settings/developers) page:
+
+- Click on your profile photo at the top right
+- Click Settings near the bottom of the menu
+- In the left sidebar, click `Developer settings` (near the bottom)
+- In the left sidebar, click `OAuth Apps`
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Register a new OAuth application
+
+- Click `Register a new application`. If you've created an app before, click `New OAuth App` here.
+- In `Application name`, type the name of your app.
+- In `Homepage URL`, type the full URL to your app's website.
+- In `Authorization callback URL`, type the callback URL of your app.
+- Enter the URL in the `Valid OAuth Redirect URIs` box.
+- Click `Save Changes` at the bottom right.
+- Click `Register Application`.
+
+Copy your new OAuth credentials
+
+- Copy and save your `Client ID`.
+- Click `Generate a new client secret`.
+- Copy and save your `Client secret`.
+
+## Enter your GitHub credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `GitHub Enabled` to ON
+- Enter your `GitHub Client ID` and `GitHub Client Secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `github` as the `provider`:
+
+```js
+async function signInWithGitHub() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'github',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [GitHub Developer Settings](https://github.com/settings/developers)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-gitlab.mdx b/apps/docs/pages/guides/auth/social-login/auth-gitlab.mdx
index 5447cc696b6..870c292a0b8 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-gitlab.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-gitlab.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-gitlab.mdx'
export const meta = {
id: 'auth-gitlab',
@@ -7,11 +6,87 @@ export const meta = {
description: 'Add GitLab OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable GitLab Auth for your project, you need to set up a GitLab OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up GitLab logins for your application consists of 3 parts:
+
+- Create and configure a GitLab Application on [GitLab](https://gitlab.com)
+- Add your GitLab Application keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your GitLab account
+
+- Go to [gitlab.com](https://gitlab.com).
+- Click on `Login` at the top right to log in.
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create your GitLab Application
+
+- Click on your `profile logo` (avatar) in the top-right corner.
+- Select `Edit profile`.
+- In the left sidebar, select Applications.
+- Enter the name of the application.
+- In the `Redirect URI` box, type the callback URL of your app.
+- Check the box next to `Confidential` (make sure it is checked).
+- Check the scope named `read_user` (this is the only required scope).
+- Click `Save Application` at the bottom.
+- Copy and save your `Application ID` (`client_id`) and `Secret` (`client_secret`) which you'll need later.
+
+## Add your GitLab credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `GitLab Enabled` to ON.
+- Enter your `client_id` and `client_secret` saved in the previous step.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `gitlab` as the `provider`:
+
+```js
+async function signInWithGitLab() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'gitlab',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [GitLab Account](https://gitlab.com)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-google.mdx b/apps/docs/pages/guides/auth/social-login/auth-google.mdx
index e19c0d8a935..4a8a2c3b222 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-google.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-google.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-google.mdx'
export const meta = {
id: 'auth-google',
@@ -7,11 +6,115 @@ export const meta = {
description: 'Add Google OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Google Auth for your project, you need to set up a Google OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Google logins for your application consists of 3 parts:
+
+- Create and configure a Google Project on the [Google Cloud Platform Console](https://console.cloud.google.com/home/dashboard)
+- Add your Google OAuth keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Google Cloud Platform account
+
+- Go to [cloud.google.com](https://cloud.google.com).
+- Click on `Sign in` at the top right to log in.
+
+
+
+## Create a Google Cloud Platform Project
+
+- Click on `Select a Project` at the top left.
+ - (Or, if a project is currently selected, click on the current project name at the top left.)
+- Click `New Project` at the top right.
+- Fill in your app information, then click `Create`.
+ - (This can take a few minutes.)
+- This should bring you to the dashboard for your new project.
+
+## Create the OAuth Keys for your project
+
+From your project's dashboard screen:
+
+- In the search bar at the top labeled `Search products and resources` type `OAuth`.
+- Click on `OAuth consent screen` from the list of results.
+- On the `OAuth consent screen` page select `External`.
+- Click `Create`.
+
+## Edit your app information
+
+- On the `Edit app registration` page fill out your app information.
+- Click `Save and continue` at the bottom.
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create your Google credentials
+
+- Click `Credentials` at the left to go to the `Credentials` page on the Google Cloud Platform console.
+- Click `Create Credentials` near the top then select `OAuth client ID`
+- On the `Create OAuth client ID` page, select your application type. If you're not sure, choose `Web application`.
+- Fill in your app name.
+- At the bottom, under `Authorized redirect URIs` click `Add URI`.
+- Enter your callback URI under `Authorized redirect URIs` at the bottom.
+- Enter your callback URI in the `Valid OAuth Redirect URIs` box.
+- Click `Save Changes` at the bottom right.
+- Click `Create`.
+
+Copy your new OAuth credentials
+
+- A box will appear called `OAuth client created`.
+- Copy and save the values under `Your Client ID` and `Your Client Secret`.
+
+## Enter your Google credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Google Enabled` to ON
+- Enter your `Google Client ID` and `Google Client Secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `google` as the `provider`:
+
+```js
+async function signInWithGoogle() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'google',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Google Cloud Platform Console](https://console.cloud.google.com/home/dashboard)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-keycloak.mdx b/apps/docs/pages/guides/auth/social-login/auth-keycloak.mdx
index e71dc8a393f..b0078e6cfae 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-keycloak.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-keycloak.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-keycloak.mdx'
export const meta = {
id: 'auth-keycloak',
@@ -7,11 +6,87 @@ export const meta = {
description: 'Add Keycloak OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Keycloak Auth for your project, you need to set up an Keycloak OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+To get started with Keycloak, you can run it in a docker container with: `docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8080:8080 jboss/keycloak:latest`
+
+This guide will be assuming that you are running keycloak in a docker container as described in the command above.
+
+Keycloak OAuth consists of five broad steps:
+
+- Create a new client in your specified keycloak realm.
+- Obtain the `issuer` from the "OpenID Endpoint Configuration". This will be used as the `Keycloak URL`.
+- Ensure that the new client has the "Client Protocol" set to "openid-connect" and the "Access Type" is set to "confidential".
+- The `Client ID` of the client created will be used as the `client id`.
+- Obtain the `Secret` from the credentials tab which will be used as the `client secret`.
+- Add the callback url of your application to your allowlist.
+
+## Access your Keycloak Admin console
+
+- Login by visiting [`http://localhost:8080`](http://localhost:8080) and clicking on "Administration Console".
+
+## Create a Keycloak Realm
+
+- Once you've logged in to the Keycloak console, you can add a realm from the side panel. The default realm should be named "Master".
+- After you've added a new realm, you can retrieve the `issuer` from the "OpenID Endpoint Configuration" endpoint. The `issuer` will be used as the `Keycloak URL`.
+- You can find this endpoint from the realm settings under the "General Tab" or visit [`http://localhost:8080/realms/my_realm_name/.well-known/openid-configuration`](http://localhost:8080/realms/my_realm_name/.well-known/openid-configuration)
+
+
+
+## Create a Keycloak Client
+
+The "Client ID" of the created client will serve as the `client_id` when you make API calls to authenticate the user.
+
+
+
+## Client Settings
+
+After you've created the client successfully, ensure that you set the following settings:
+
+1. The "Client Protocol" should be set to "openid-connect".
+2. The "Access Type" should be set to "confidential".
+3. The "Valid Redirect URIs" should be set to: `https://.supabase.co/auth/v1/callback`.
+
+
+
+
+## Obtain the Client Secret
+
+This will serve as the `client_secret` when you make API calls to authenticate the user.
+Under the "Credentials" tab, the `Secret` value will be used as the `client secret`.
+
+
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `keycloak` as the `provider`:
+
+```js
+async function signInWithKeycloak() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'keycloak',
+ options: {
+ scopes: 'openid',
+ },
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- You can find the keycloak openid endpoint configuration under the realm settings.
+ 
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-linkedin.mdx b/apps/docs/pages/guides/auth/social-login/auth-linkedin.mdx
index a027c482afc..22fb6f1f05e 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-linkedin.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-linkedin.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-linkedin.mdx'
export const meta = {
id: 'auth-linkedin',
@@ -7,11 +6,86 @@ export const meta = {
description: 'Add LinkedIn OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable LinkedIn Auth for your project, you need to set up a LinkedIn OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up LinkedIn logins for your application consists of 3 parts:
+
+- Create and configure a LinkedIn Project and App on the [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
+- Add your LinkedIn `client_id` and `client_secret` to your [Supabase Project](https://app.supabase.com).
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
+
+## Access your LinkedIn Developer account
+
+- Go to [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
+- Log in (if necessary.)
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a LinkedIn OAuth app
+
+- Go to [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
+- Click on `Create App` at the top right
+- Enter your `LinkedIn Page` and `App Logo`
+- Save your app
+- Click `Auth` from the top menu
+- Add your `Redirect URL` to the `Authorized Redirect URLs for your app` section
+- Copy and save your newly-generated `Client ID`
+- Copy and save your newly-generated `Client Secret`
+
+## Enter your LinkedIn credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `LinkedIn Enabled` to ON.
+- Enter your `client_id` and `client_secret` saved in the previous step.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `linkedin` as the `provider`:
+
+```js
+async function signInWithLinkedIn() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'linkedin',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [LinkedIn Developer Dashboard](https://api.LinkedIn.com/apps)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-notion.mdx b/apps/docs/pages/guides/auth/social-login/auth-notion.mdx
index 50dc672d080..1f1d74e465a 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-notion.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-notion.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-notion.mdx'
export const meta = {
id: 'auth-notion',
@@ -7,11 +6,90 @@ export const meta = {
description: 'Add Notion OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Notion Auth for your project, you need to set up a Notion Application and add the Application OAuth credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Notion logins for your application consists of 3 parts:
+
+- Create and configure a Notion Application [Notion Developer Portal](https://www.notion.so/my-integrations)
+- Retrieve your OAuth client ID and OAuth client secret and add them to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Create your notion integration
+
+- Go to [developers.notion.com](https://developers.notion.com/).
+- Click "View my integrations" and login.
+
+
+
+- Once logged in, go to [notion.so/my-integrations](https://notion.so/my-integrations) and create a new integration.
+- When creating your integration, ensure that you select "Public integration" under "Integration type" and "Read user information including email addresses" under "Capabilities".
+- You will need to add a redirect uri, see [Add the redirect uri](#add-the-redirect-uri)
+- Once you've filled in the necessary fields, click "Submit" to finish creating the integration.
+
+
+
+## Add the redirect URI
+
+- After selecting "Public integration", you should see an option to add "Redirect URIs".
+
+
+
+You can retrieve the redirect uri with the following steps:
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+Your redirect uri should look like the following: `https://.supabase.co/auth/v1/callback`
+
+
+
+## Add your Notion credentials into your Supabase Project
+
+- Once you've created your notion integration, you should be able to retrieve the "OAuth client ID" and "OAuth client secret" from the "OAuth Domain and URIs" tab.
+
+
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Under `External OAuth Providers` turn `Notion Enabled` to ON
+- Enter the "OAuth client ID" and "OAuth client secret" obtained in the `client id` and `client secret` fields.
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `notion` as the `provider`:
+
+```js
+async function signInWithNotion() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'notion',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Notion Account](https://notion.so)
+- [Notion Developer Portal](https://www.notion.so/my-integrations)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-slack.mdx b/apps/docs/pages/guides/auth/social-login/auth-slack.mdx
index b724a321068..6d700e6f961 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-slack.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-slack.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-slack.mdx'
export const meta = {
id: 'auth-slack',
@@ -7,11 +6,99 @@ export const meta = {
description: 'Add Slack OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Slack Auth for your project, you need to set up a Slack OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Slack logins for your application consists of 3 parts:
+
+- Create and configure a Slack Project and App on the [Slack Developer Dashboard](https://api.slack.com/apps).
+- Add your Slack `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
+
+## Access your Slack Developer account
+
+- Go to [api.slack.com](https://api.slack.com/apps).
+- Click on `Your Apps` at the top right to log in.
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Slack OAuth app
+
+- Go to [api.slack.com](https://api.slack.com/apps).
+- Click on `Create an App`
+
+Under `Create an app...`:
+
+- Click `From scratch`
+- Type the name of your app
+- Select your `Slack Workspace`
+- Click `Create App`
+
+Under `App Credentials`:
+
+- Copy and save your newly-generated `Client ID`
+- Copy and save your newly-generated `Client Secret`
+- Click `Permissions`
+
+Under `Redirect URLs`:
+
+- Click `Add New Redirect URL`
+- Paste your `Callback URL` then click `Add`
+- Click `Save URLs`
+
+## Enter your Slack credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `Slack Enabled` to ON.
+- Enter your `Client ID` (`client_id`) and `Client Secret` (`client_secret`) saved in the previous step.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `slack` as the `provider`:
+
+```js
+async function signInWithSlack() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'slack',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Slack Developer Dashboard](https://api.slack.com/apps)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-spotify.mdx b/apps/docs/pages/guides/auth/social-login/auth-spotify.mdx
index 69c931f6f7d..c5f3a0872f2 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-spotify.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-spotify.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-spotify.mdx'
export const meta = {
id: 'auth-spotify',
@@ -7,11 +6,94 @@ export const meta = {
description: 'Add Spotify OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Spotify Auth for your project, you need to set up a Spotify OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Spotify logins for your application consists of 3 parts:
+
+- Create and configure a Spotify Project and App on the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/).
+- Add your Spotify `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
+
+## Access your Spotify Developer account
+
+- Log into [Spotify](https://spotify.com)
+- Access the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Spotify OAuth app
+
+- Log into [Spotify](https://spotify.com).
+- Go to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)
+- Click `Create an App`
+- Type your `App name`
+- Type your `App description`
+- Check the box to agree with the `Developer TOS and Branding Guidelines`
+- Click `Create`
+- Save your `Client ID`
+- Save your `Client Secret`
+- Click `Edit Settings`
+
+Under `Redirect URIs`:
+
+- Paste your Supabase Callback URL in the box
+- Click `Add`
+- Click `Save` at the bottom
+
+## Enter your Spotify credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `Spotify Enabled` to ON.
+- Enter your `Client ID` (`client_id`) and `Client Secret` (`client_secret`) saved in the previous step.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `spotify` as the `provider`:
+
+```js
+async function signInWithSpotify() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'spotify',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-twilio.mdx b/apps/docs/pages/guides/auth/social-login/auth-twilio.mdx
deleted file mode 100644
index 922d4a33db1..00000000000
--- a/apps/docs/pages/guides/auth/social-login/auth-twilio.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-twilio.mdx'
-
-export const meta = {
- id: 'auth-twilio',
- title: 'Phone Auth with Twilio',
- description: 'How to set up and use Mobile OTP with Twilio and Supabase.',
-}
-
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
-}
-
-export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-twitch.mdx b/apps/docs/pages/guides/auth/social-login/auth-twitch.mdx
index ae5a108d34f..fab1f8e42e3 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-twitch.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-twitch.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-twitch.mdx'
export const meta = {
id: 'auth-twitch',
@@ -7,11 +6,106 @@ export const meta = {
description: 'Add Twitch OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Twitch Auth for your project, you need to set up a Twitch Application and add the Application OAuth credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Twitch logins for your application consists of 3 parts:
+
+- Create and configure a Twitch Application [Twitch Developer Console](https://dev.twitch.tv/console)
+- Add your Twitch OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Twitch Developer account
+
+- Go to [dev.twitch.tv](https://dev.twitch.tv).
+- Click on `Log in with Twitch` at the top right to log in.
+- If you have not already enabled 2-Factor Authentication for your Twitch Account, you will need to do that at [Twitch Security Settings](https://www.twitch.tv/settings/security) before you can continue.
+
+
+
+- Once logged in, go to the [Twitch Developer Console](https://dev.twitch.tv/console).
+
+
+
+## Find your callback URL
+
+In the next step you require a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Twitch Application
+
+
+
+- Click on `+ Register Your Application` at the top right.
+
+
+
+- Enter the name of your application.
+- Type or paste your `OAuth Redirect URL` (the callback URL from the previous step.)
+- Select a category for your app.
+- Check the Captcha box and click `Create`.
+
+## Retrieve your Twitch OAuth Client ID and Client Secret
+
+- Click `Manage` at the right of your application entry in the list.
+
+
+
+- Copy your Client ID.
+- Click `New Secret` to create a new Client Secret.
+- Copy your Client Secret.
+
+
+
+## Add your Twitch credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Twitch Enabled` to ON
+- Enter your `client_id` and `client_secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `twitch` as the `provider`:
+
+```js
+async function signInWithTwitch() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'twitch',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Twitch Account](https://twitch.tv)
+- [Twitch Developer Console](https://dev.twitch.tv/console)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-twitter.mdx b/apps/docs/pages/guides/auth/social-login/auth-twitter.mdx
index c29dbe75b23..40cf31af0da 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-twitter.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-twitter.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-twitter.mdx'
export const meta = {
id: 'auth-twitter',
@@ -7,11 +6,95 @@ export const meta = {
description: 'Add Twitter OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Twitter Auth for your project, you need to set up a Twitter OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Twitter logins for your application consists of 3 parts:
+
+- Create and configure a Twitter Project and App on the [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard).
+- Add your Twitter `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
+
+## Access your Twitter Developer account
+
+- Go to [developer.twitter.com](https://developer.twitter.com).
+- Click on `Sign in` at the top right to log in.
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Twitter OAuth app
+
+- Click `+ Create Project`.
+ - Enter your project name, click `Next`.
+ - Select your use case, click `Next`.
+ - Enter a description for your project, click `Next`.
+ - Enter a name for your app, click `Complete`.
+ - Copy and save your `API Key` (this is your `client_id`).
+ - Copy and save your `API Secret Key` (this is your `client_secret`).
+- At the bottom, under `Next, setup your App` click the link `enable 3rd party authentication`.
+- Under `App Settings`, click on the gear icon next to your app name to go to `App Settings`.
+- At the bottom, next to `Authentication settings`, click `Edit`.
+- Turn `Enable 3-legged OAuth` ON.
+- Turn `Request email address from users` ON.
+- Enter your `Callback URL`.
+- Enter your `Website URL`.
+- Enter your `Terms of service URL`.
+- Enter your `Privacy policy URL`.
+- Click `Save`.
+
+## Enter your Twitter credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- In the left sidebar, click the `Authentication` icon (near the top).
+- Click `Settings` from the list to go to the `Authentication Settings` page.
+- Enter the final (hosted) URL of your app under `Site URL` (this is important).
+- Under `External OAuth Providers` turn `Twitter Enabled` to ON.
+- Enter your `API Key` (`client_id`) and `API Secret Key` (`client_secret`) saved in the previous step.
+- Click `Save`.
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `twitter` as the `provider`:
+
+```js
+async function signInWithTwitter() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'twitter',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-workos.mdx b/apps/docs/pages/guides/auth/social-login/auth-workos.mdx
index 54ab92808ce..806a838207a 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-workos.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-workos.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-workos.mdx'
export const meta = {
id: 'auth-workos',
@@ -7,11 +6,88 @@ export const meta = {
description: 'Add WorkOS OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable WorkOS Auth for your project, you need to set up WorkOS OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+In this guide, we will cover how to use Supabase OAuth with WorkOS to implement Single-Sign-On(SSO).
+
+The procedure consists of five broad steps:
+
+- Create a new organization from your WorkOS Dashboard.
+- Obtain the `Client ID` from the Configuration tab and configure redirect URI.
+- Obtain the `WorkOS Secret` from the credentials tab.
+- Connect a WorkOS Supported Identity Provider
+- Add your WorkOS credentials into your Supabase project
+
+## Create a WorkOS Organization
+
+Log in to the dashboard and hop over to the Organizations tab to create and organization
+
+
+## Obtain the Client ID and configure Redirect URI
+
+Head over to the Configuration tab and configure the redirect URI.The redirect URI should look like `https://.supabase.co/auth/v1/callback`
+Note that this is distinct from the redirect URI referred to in the Supabase dashboard
+
+
+
+## Obtain the WorkOS Secret
+
+Head over to the API Keys page and obtain the secret key.
+
+
+
+## Connect a WorkOS Supported Identity Provider
+
+Set up the identity provider by visiting the setup link.
+
+
+
+You can pick between any one of the many identity providers that WorkOS supports.
+
+## Add your WorkOS credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Under `External OAuth Providers` turn `WorkOS Enabled` to ON
+- Enter the `Client ID`, `Secret`, and `WorkOS URL` saved in the previous steps. The ``WorkOS URL` setting should be set to https://api.workos.com/
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `workos` as the `provider`:
+
+```js
+async function signInWithWorkOS() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'workos',
+ options: {
+ queryParams: {
+ connection: '',
+ organization: '',
+ },
+ },
+ })
}
+```
+
+Refer to the [WorkOS Documentation](https://workos.com/docs/reference/sso/authorize/) to learn more about the different methods.
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [WorkOS Documentation](https://workos.com/docs/sso/guide)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/auth/social-login/auth-zoom.mdx b/apps/docs/pages/guides/auth/social-login/auth-zoom.mdx
index 148b9772219..13d9de860c5 100644
--- a/apps/docs/pages/guides/auth/social-login/auth-zoom.mdx
+++ b/apps/docs/pages/guides/auth/social-login/auth-zoom.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/auth/auth-zoom.mdx'
export const meta = {
id: 'auth-zoom',
@@ -7,11 +6,95 @@ export const meta = {
description: 'Add Zoom OAuth to your Supabase project',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+To enable Zoom Auth for your project, you need to set up a Zoom OAuth application and add the application credentials to your Supabase Dashboard.
+
+## Overview
+
+Setting up Zoom logins for your application consists of 3 parts:
+
+- Create and configure a Zoom OAuth App on [Zoom App Marketplace](https://marketplace.zoom.us/)
+- Add your Zoom OAuth keys to your [Supabase Project](https://app.supabase.com)
+- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
+
+## Access your Zoom Developer account
+
+- Go to [marketplace.zoom.us](https://marketplace.zoom.us/).
+- Click on `Sign In` at the top right to log in.
+
+
+
+## Find your callback URL
+
+The next step requires a callback URL, which looks like this:
+
+`https://.supabase.co/auth/v1/callback`
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com).
+- Click on the `Settings` icon at the bottom of the left sidebar.
+- Click on `API` in the list.
+- Under Config / URL you'll find your API URL, you can click `Copy` to copy it to the clipboard.
+- Now just add `/auth/v1/callback` to the end of that to get your full `OAuth Redirect URI`.
+
+
+
+## Create a Zoom Oauth App
+
+- Go to [marketplace.zoom.us](https://marketplace.zoom.us/).
+- Click on `Sign In` at the top right to log in.
+- Click `Build App` (from the dropdown Develop)
+- In the OAuth card, click `Create`
+- Type the name of your app
+- Choose app type
+- Click `Create`
+
+Under `App credentials`
+
+- Copy and save your `Client ID`.
+- Copy and save your `Client secret`.
+
+Under `Redirect URL for OAuth`
+
+- Paste your `Callback URL`
+- Click `Continue`
+
+## Enter your Zoom credentials into your Supabase Project
+
+- Go to your [Supabase Project Dashboard](https://app.supabase.com)
+- In the left sidebar, click the `Authentication` icon (near the top)
+- Click `Settings` from the list to go to the `Authentication Settings` page
+- Enter the final (hosted) URL of your app under `Site URL` (this is important)
+- Under `External OAuth Providers` turn `Zoom Enabled` to ON
+- Enter your `Zoom Client ID` and `Zoom Client Secret` saved in the previous step
+- Click `Save`
+
+## Add login code to your client app
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `zoom` as the `provider`:
+
+```js
+async function signInWithZoom() {
+ const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'zoom',
+ })
}
+```
+
+When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```js
+async function signout() {
+ const { error } = await supabase.auth.signOut()
+}
+```
+
+## Resources
+
+- [Supabase Account - Free Tier OK](https://supabase.com)
+- [Supabase JS Client](https://github.com/supabase/supabase-js)
+- [Zoom App Marketplace](https://marketplace.zoom.us/)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/cli.mdx b/apps/docs/pages/guides/cli.mdx
deleted file mode 100644
index ef861654950..00000000000
--- a/apps/docs/pages/guides/cli.mdx
+++ /dev/null
@@ -1,122 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'cli',
- title: 'Supabase CLI',
- description:
- 'The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform.',
- sidebar_label: 'Overview',
- toc_max_heading_level: 2,
-}
-
-The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform.
-You can also use the CLI to manage your Supabase projects, handle database migrations and CI/CD workflows, and generate types directly from your database schema.
-
-## Installation
-
-
-
-
-Install the CLI as dev dependency via [npm](https://www.npmjs.com/package/supabase):
-
-```sh
-npm install supabase --save-dev
-```
-
-
-
-
-Install the CLI with [Homebrew](https://brew.sh):
-
-```sh
-brew install supabase/tap/supabase
-```
-
-
-
-
-Install the CLI with [Scoop](https://scoop.sh):
-
-```powershell
-scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
-scoop install supabase
-```
-
-
-
-
-The CLI is available through [Homebrew](https://brew.sh) and Linux packages.
-
-#### Homebrew
-
-```sh
-brew install supabase/tap/supabase
-```
-
-#### Linux packages
-
-Linux packages are provided in [Releases](https://github.com/supabase/cli/releases).
-To install, download the `.apk`/`.deb`/`.rpm` file depending on your package manager
-and run one of the following:
-
-- `sudo apk add --allow-untrusted <...>.apk`
-- `sudo dpkg -i <...>.deb`
-- `sudo rpm -i <...>.rpm`
-
-
-
-
-## Updates
-
-When a new [version](https://github.com/supabase/cli/releases) is released, you can update the CLI using the same methods.
-
-
-
-
-```sh
-npm update supabase --save-dev
-```
-
-
-
-
-```sh
-brew upgrade supabase
-```
-
-
-
-
-```powershell
-scoop update supabase
-```
-
-
-
-
-```sh
-brew upgrade supabase
-```
-
-
-
-
-## See also
-
-- [Supabase CLI Reference](/docs/reference/cli/usage)
-- [Local Development](/docs/guides/cli/local-development)
-- [Managing Environments](/docs/guides/cli/managing-environments)
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/cli/local-development.mdx b/apps/docs/pages/guides/cli/local-development.mdx
deleted file mode 100644
index 4586927a3f4..00000000000
--- a/apps/docs/pages/guides/cli/local-development.mdx
+++ /dev/null
@@ -1,261 +0,0 @@
-import Layout from '~/layouts/DefaultGuideLayout'
-
-export const meta = {
- id: 'local-development',
- title: 'Local Development',
- description: 'How to use Supabase on your local development machine.',
-}
-
-Learn how to use the Supabase CLI to develop your project locally and deploy to the Supabase Platform.
-
-
-
-
-
-## Prerequisites
-
-Make sure you have these installed on your local machine:
-
-- [Docker](https://docs.docker.com/engine/install/)
-- [Git](https://github.com/git-guides/install-git)
-- [Supabase CLI](/docs/guides/cli)
-
-## Log in to the Supabase CLI
-
-```bash
-supabase login
-```
-
-## Initialize your project
-
-Create a new folder for your project and start a new git repository:
-
-```bash
-# create your project folder
-mkdir your-project
-
-# move into the new folder
-cd your-project
-
-# start a new git repository
-git init
-```
-
-## Start Supabase services
-
-[Initialize](/docs/reference/cli/usage#supabase-init) Supabase to set up the configuration for developing your project locally:
-
-```bash
-supabase init
-```
-
-Make sure Docker is running. The [start](/docs/reference/cli/usage#supabase-start) command uses Docker to start the Supabase [services](/docs/architecture).
-This command may take a while to run if this is the first time using the CLI.
-
-```bash
-supabase start
-```
-
-Once all of the Supabase services are running, you'll see output containing your local Supabase credentials.
-You can use the [stop](/docs/reference/cli/usage#supabase-stop) command at any time to stop all services.
-
-## Access services
-
-You can access services directly with any Postgres client or through the API Gateway ([Kong](https://github.com/Kong/kong)).
-
-
-
-
-```sh
-# Default URL:
-postgresql://postgres:postgres@localhost:54322/postgres
-```
-
-The local Postgres instance can be accessed through [`psql`](https://www.postgresql.org/docs/current/app-psql.html)
-or any other Postgres client, such as [pgadmin](https://www.pgadmin.org/).
-
-For example:
-
-```bash
-psql 'postgresql://postgres:postgres@localhost:54322/postgres'
-```
-
-
-
-To access the database from an edge function in your local Supabase setup, replace `localhost` with `host.docker.internal`.
-
-
-
-
-
-
-```sh
-# Default URL:
-http://localhost:54321
-```
-
-If you are accessing these services without the client libraries, you may need to pass the client keys as an `Authorization` header.
-Learn more about [JWT headers](/docs/learn/auth-deep-dive/auth-deep-dive-jwts).
-
-```sh
-curl 'http://localhost:54321/rest/v1/' \
- -H "apikey: " \
- -H "Authorization: Bearer "
-
-http://localhost:54321/rest/v1/ # REST (PostgREST)
-http://localhost:54321/realtime/v1/ # Realtime
-http://localhost:54321/storage/v1/ # Storage
-http://localhost:54321/auth/v1/ # Auth (GoTrue)
-```
-
-
-
-`` is provided when you run the command `supabase start`.
-
-
-
-
-
-
-## Database migrations
-
-Database changes are managed through "migrations." Database migrations are a common way of tracking changes to your database over time.
-
-
-
-
-
-### Make database changes
-
-For this guide, create a table called `employees`. In Supabase Studio, navigate to the **SQL Editor** page and run the following SQL command:
-
-```sql
-create table employees (
- id integer primary key generated always as identity,
- name text
-);
-```
-
-
-
-You can execute any SQL using the `DB URL` shown by [`supabase status`](/docs/reference/cli/usage#supabase-status).
-
-
-
-Run the [`db diff`](/docs/reference/cli/usage#supabase-db-diff) command to detect changes in the local database:
-
-```sh
-supabase db diff create_employees -f create_employees
-```
-
-This creates a new migration named `supabase/migrations/_create_employees.sql`, representing any changes made to the local database since [`supabase start`](/docs/reference/cli/usage#supabase-start).
-
-### Add sample data
-
-Use the seed script in `supabase/seed.sql` (created with [`supabase init`](/docs/reference/cli/usage#supabase-init)) to add sample data to the table.
-
-```sql
--- in supabase/seed.sql
-insert into public.employees (name)
-values
- ('Erlich Backman'),
- ('Richard Hendricks'),
- ('Monica Hall');
-```
-
-Rerun the migration and seed scripts:
-
-```bash
-supabase db reset
-```
-
-You should now see the contents of `employees` in Studio.
-
-### Reset database changes
-
-Use the [`reset`](/docs/reference/cli/usage#supabase-db-reset) command to revert any changes to the local database.
-
-```sql
--- run on local database to make a change
-alter table employees
- add department text default 'Hooli';
-```
-
-Run the following command to reset the local database:
-
-```sh
-supabase db reset
-```
-
-## Deploy your project
-
-Go to the [Supabase Dashboard](https://app.supabase.com) and create a project to deploy the changes.
-
-### Link your project
-
-
-
-There are a few commands required to link your project. We are in the process of consolidating these commands into a single command. Bear with us!
-
-
-
-Associate your project with your remote project using [`supabase link`](/docs/reference/cli/usage#supabase-link).
-
-```bash
-supabase link --project-ref
-# You can get from your project’s dashboard URL: https://app.supabase.com/project/
-
-supabase db remote commit
-# Capture any changes that you have made to your database before setting up the CLI
-```
-
-`supabase/migrations` is now populated with a migration in `..._remote_commit.sql`.
-This migration captures any changes required for your local database to match the schema of your remote Supabase project.
-
-### Deploy database changes
-
-Deploy any local database migrations using [`db push`](/docs/reference/cli/usage#supabase-db-push):
-
-```sh
-supabase db push
-```
-
-### Deploy Edge Functions
-
-Deploy any Edge Functions using [`functions deploy`](/docs/reference/cli/usage#supabase-functions-deploy):
-
-```sh
-supabase functions deploy
-```
-
-## Limitations
-
-The local development environment is not as feature-complete as the Supabase Platform. Here are some of the differences:
-
-- The Storage interface is coming soon.
-- The Functions interface is coming soon.
-- Logs are not supported through the interface (however you can access them through the Docker containers).
-- You cannot update your project settings in the Dashboard—this must be done using the CLI.
-
-```
-
-```
-
-export const Page = ({ children }) =>
-
-export default Page
diff --git a/apps/docs/pages/guides/database/overview.mdx b/apps/docs/pages/guides/database/overview.mdx
index 1cfbc2357db..7efa2ad7513 100644
--- a/apps/docs/pages/guides/database/overview.mdx
+++ b/apps/docs/pages/guides/database/overview.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/database.mdx'
export const meta = {
id: 'database',
@@ -8,11 +7,87 @@ export const meta = {
sidebar_label: 'Overview',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
-}
+Every Supabase project comes with a full [Postgres](https://www.postgresql.org/) database, a free and open source
+database which is considered one of the world's most stable and advanced databases.
+
+## Postgres or PostgreSQL?
+
+PostgreSQL the database was derived from the POSTGRES Project, a package written at the University of California at Berkeley in 1986.
+This package included a query language called "PostQUEL".
+
+In 1994, Postgres95 was built on top of POSTGRES code, adding an SQL language interpreter as a replacement for PostQUEL.
+Eventually, Postgres95 was renamed to PostgreSQL to reflect the SQL query capability.
+
+After this, many people referred to it as Postgres since it's less prone to confusion. Supabase is all about
+simplicity, so we also refer to it as Postgres.
+
+## Features
+
+### Table View
+
+You don't have to be a database expert to start using Supabase. Our table view makes Postgres as easy to use as a spreadsheet.
+
+
+
+### Relationships
+
+Dig into the relationships within your data.
+
+
+
+### Clone tables
+
+You can duplicate your tables, just like you would inside a spreadsheet.
+
+
+
+### The SQL Editor
+
+Supabase comes with a SQL Editor. You can also save your favorite queries to run later!
+
+
+
+### Additional features
+
+- Supabase extends Postgres with realtime functionality using our [Realtime Server](https://github.com/supabase/realtime).
+- Every project is a full Postgres database, with `postgres` level access.
+- Supabase manages your database backups.
+- Import data directly from a CSV or excel spreadsheet.
+
+
+
+Database backups **do not** include objects stored via the Storage API, as the database only
+includes metadata about these objects. Restoring an old backup does not restore objects that have
+been deleted since then.
+
+
+
+### Extensions
+
+To expand the functionality of your Postgres database, you can use extensions.
+You can enable Postgres extensions with the click of a button within the Supabase dashboard.
+
+
+
+[Learn more](/docs/guides/database/extensions) about all the extensions provided on Supabase.
+
+## Tips
+
+Read about resetting your database password [here](/docs/guides/database/managing-passwords) and changing the timezone of your server [here](/docs/guides/database/managing-timezones).
+
+## Next steps
+
+- Read more about [Postgres](https://www.postgresql.org/about/)
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/getting-started.mdx b/apps/docs/pages/guides/getting-started.mdx
index f751794966c..aa58bb10dd9 100644
--- a/apps/docs/pages/guides/getting-started.mdx
+++ b/apps/docs/pages/guides/getting-started.mdx
@@ -157,8 +157,7 @@ export const resources = [
title: 'Architecture',
hasLightIcon: true,
href: '/architecture',
- description:
- 'An overview of Supabase\'s architecture and product principles.',
+ description: "An overview of Supabase's architecture and product principles.",
},
]
diff --git a/apps/docs/pages/guides/getting-started/architecture.mdx b/apps/docs/pages/guides/getting-started/architecture.mdx
index 2552c09bcf1..91048898791 100644
--- a/apps/docs/pages/guides/getting-started/architecture.mdx
+++ b/apps/docs/pages/guides/getting-started/architecture.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/architecture.mdx'
export const meta = {
id: 'architecture',
@@ -7,11 +6,157 @@ export const meta = {
description: 'Supabase design and architecture',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
-}
+Supabase is open source. We choose open source tools which are scalable and make them simple to use.
+
+Supabase is not a 1-to-1 mapping of Firebase. While we are building many of the features that Firebase offers, we are not going about it the same way:
+our technological choices are quite different; everything we use is open source; and wherever possible, we use and support existing tools rather than developing from scratch.
+
+Most notably, we use Postgres rather than a NoSQL store. This choice was deliberate. We believe that no other database offers the functionality required to compete with Firebase,
+while maintaining the scalability required to go beyond it.
+
+## Architecture
+
+Each Supabase project consists of several tools:
+
+
+
+### PostgreSQL (Database)
+
+PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database — you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase.
+
+- Official Docs: [postgresql.org/docs](https://www.postgresql.org/docs/current/index.html)
+- Source code: [github.com/postgres/postgres](https://github.com/postgres/postgres) (mirror)
+- License: [PostgreSQL Licence](https://www.postgresql.org/about/licence/)
+- Language: C
+
+### Studio (Dashboard)
+
+An open source Dashboard for managing your database and services.
+
+- Official Docs: [Supabase docs](/docs)
+- Source code: [github.com/supabase/supabase](https://github.com/supabase/supabase/tree/master/studio)
+- License: [Apache 2](https://github.com/supabase/supabase/blob/master/LICENSE)
+- Language: TypeScript
+
+### GoTrue (Auth)
+
+A JWT-based API for managing users and issuing access tokens. This integrates with PostgreSQL's Row Level Security and the API servers.
+
+- Official Docs: [Supabase Auth reference docs](/docs/reference/auth)
+- Source code: [github.com/supabase/gotrue](https://github.com/supabase/gotrue)
+- License: [MIT](https://github.com/supabase/gotrue/blob/master/LICENSE)
+- Language: Go
+
+### PostgREST (API)
+
+A standalone web server that turns your PostgreSQL database directly into a RESTful API.
+We use this with our [pg_graphql](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API.
+
+- Official Docs: [postgrest.org](https://postgrest.org/)
+- Source code: [github.com/PostgREST/postgrest](https://github.com/PostgREST/postgrest)
+- License: [MIT](https://github.com/PostgREST/postgrest/blob/main/LICENSE)
+- Language: Haskel
+
+### Realtime (API & multiplayer)
+
+A scalable websocket engine for managing user Presence, broadcasting messages, and streaming database changes.
+
+- Official Docs: [Supabase Realtime docs](/docs/guides/realtime)
+- Source code: [github.com/supabase/realtime](https://github.com/supabase/realtime)
+- License: [Apache 2](https://github.com/supabase/realtime/blob/master/LICENSE)
+- Language: Elixir
+
+### Storage API (large file storage)
+
+An S3-compatible object storage service that stores metadata in Postgres.
+
+- Official Docs: [Supabase Storage reference docs](/docs/reference/storage)
+- Source code: [github.com/supabase/storage-api](https://github.com/supabase/storage-api)
+- License: [Apache 2.0](https://github.com/supabase/storage-api/blob/master/LICENSE)
+- Language: NodeJS / TypeScript
+
+### Deno (Edge Functions)
+
+A modern runtime for JavaScript and TypeScript.
+
+- Official Docs: [deno.land](https://deno.land/)
+- Source code: [github.com/denoland/deno](https://github.com/denoland/deno)
+- License: [MIT](https://github.com/denoland/deno/blob/main/LICENSE.md)
+- Language: TypeScript / Rust
+
+### postgres-meta (Database management)
+
+A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries.
+
+- Official Docs: [supabase.github.io/postgres-meta](https://supabase.github.io/postgres-meta/)
+- Source code: [github.com/supabase/postgres-meta](https://github.com/supabase/postgres-meta)
+- License: [Apache 2.0](https://github.com/supabase/postgres-meta/blob/master/LICENSE)
+- Language: NodeJS / TypeScript
+
+### PgBouncer
+
+A lightweight connection pooler for PostgreSQL. This is useful for connecting to Postgres when using Serverless functions.
+
+- Official Docs: [pgbouncer.org](http://www.pgbouncer.org/)
+- Source code: [pgbouncer/pgbouncer](https://github.com/pgbouncer/pgbouncer)
+- License: [ISC](https://github.com/pgbouncer/pgbouncer/blob/master/COPYRIGHT)
+- Language: C
+
+### Kong (API Gateway)
+
+A cloud-native API gateway, built on top of Nginx.
+
+- Official Docs: [docs.konghq.com](https://docs.konghq.com/)
+- Source code: [github.com/kong/kong](https://github.com/kong/kong)
+- License: [Apache 2.0](https://github.com/Kong/kong/blob/master/LICENSE)
+- Language: Lua
+
+## Product Principles
+
+It is our goal to provide an architecture that any large-scale company would design for themselves,
+and then provide tooling around that architecture that is easy-to-use for indie-developers and small teams.
+
+We use a series of principles to ensure that scalability and usability are never mutually exclusive:
+
+### Everything works in isolation
+
+Each system must work as a standalone tool with as few moving parts as possible.
+The litmus test for this is: "Can a user run this product with nothing but a Postgres database?"
+
+### Everything is integrated
+
+Supabase is composable. Even though every product works in isolation, each product on the platform needs to 10x the other products.
+For integration, each tool should expose an API and Webhooks.
+
+### Everything is extensible
+
+We're deliberate about adding a new tool, and prefer instead to extend an existing one.
+This is the opposite of many cloud providers whose product offering expands into niche use-cases. We provide _primitives_ for developers, which allow them to achieve any goal.
+Less, but better.
+
+### Everything is portable
+
+To avoid lock-in, we make it easy to migrate in and out. Our cloud offering is compatible with our self-hosted product.
+We use existing standards to increase portability (like pg_dump an CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard.
+This forces us compete on experience. We aim to be the best Postgres hosting service.
+
+### Play the long game
+
+We sacrifice short-term wins for long-term gains. For example, it is tempting to run a fork of Postgres with additional functionality which only our customers need.
+Instead, we prefer to support efforts to upstream missing functionality so that the entire community benefits. This has the additional benefit of ensuring portability and longevity.
+
+### Build for developers
+
+"Developers" are a specific profile of user: they are _builders_.
+When assessing impact as a function of effort, developers have a large efficiency due to the type of products and systems they can build.
+As the profile of a developer changes over time, Supabase will continue to evolve the product to fit this evolving profile.
+
+### Support existing tools
+
+Supabase supports existing tools and communities wherever possible. Supabase is more like a "community of communities" - each tool typically has its own community
+which we work with.
+Open source is something we approach [collaboratively](https://supabase.com/blog/supabase-series-b#giving-back): we employ maintainers, sponsor projects, invest in businesses, and develop our own open source tools.
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/getting-started/features.mdx b/apps/docs/pages/guides/getting-started/features.mdx
old mode 100644
new mode 100755
index b81ad1d6a29..4b10f3830ba
--- a/apps/docs/pages/guides/getting-started/features.mdx
+++ b/apps/docs/pages/guides/getting-started/features.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/features.mdx'
export const meta = {
id: 'features',
@@ -7,11 +6,179 @@ export const meta = {
description: 'Supabase features',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
-}
+This is a non-exhaustive list of features that Supabase provides for every project.
+
+## Database
+
+### Postgres Database
+
+Every project is a full Postgres database. [Docs](/docs/guides/database).
+
+### Database Extensions
+
+Every database comes with a full set of Postgres extensions. [Docs](/docs/guides/database/extensions).
+
+### Database Functions
+
+Create custom database functions which you can call from the browser. [Docs](/docs/guides/database/functions).
+
+### Database Triggers
+
+Attach triggers to your tables to handle database changes. [Docs](/docs/guides/auth/managing-user-data#using-triggers).
+
+### Database Webhooks
+
+Send database changes to any external service using Webhooks. [Link](https://supabase.com/blog/supabase-functions-updates#database-webhooks-alpha).
+
+### Database Backups
+
+Projects are backed up daily with the option to upgrade to Point in Time recovery.
+
+### Search
+
+Build search functionality using Postgres Full Text Search. [Docs](/docs/guides/database/full-text-search).
+
+### Secrets and encryption
+
+Encrypt sensitive data and store secrets using our Postgres extension, Supabase Vault. [Link](https://supabase.com/blog/supabase-vault).
+
+### Database migrations
+
+Develop locally and push your changes to your production database using migrations. [Docs](/docs/guides/cli/local-development#database-migrations)
+
+
+
+## Auth
+
+### Email & Password Logins
+
+Build email logins for your application or website. [Docs](/docs/guides/auth/auth-email).
+
+### Magic Links
+
+Build passwordless logins for your application or website.[Docs](/docs/guides/auth/auth-magic-link).
+
+### Social Logins
+
+Provide social logins - everything from Apple, to GitHub, to Slack. [Docs](/docs/guides/auth/auth-apple).
+
+### Phone Logins
+
+Provide phone logins using a 3rd-party SMS provider. [Docs](/docs/guides/auth/auth-twilio).
+
+### Row Level Security
+
+Control the data each user can access with Postgres Policies. [Docs](/docs/guides/auth/row-level-security).
+
+### Serverside Auth Helpers
+
+Helpers for implementing user authentication in popular frameworks like [Next.js](/docs/guides/auth/auth-helpers/nextjs) and [SvelteKit](/docs/guides/auth/auth-helpers/sveltekit)
+
+### Auth UI Kit
+
+Build login and registration pages with custom themes. [Docs](/docs/guides/auth/auth-helpers/auth-ui).
+
+
+
+## APIs & Client libraries
+
+### Auto-generated REST API
+
+RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview).
+
+### Auto-generated GraphQL API
+
+Fast GraphQL APIs using our custom Postgres GraphQL extension. [Docs](/docs/guides/api#graphql-api-overview).
+
+### Realtime Database changes
+
+Receive your database changes through websockets. [Docs](/docs/guides/realtime/postgres-changes).
+
+### User Broadcasting
+
+Send messages between connected users through websockets. [Docs](/docs/guides/realtime#broadcast).
+
+### User Presence
+
+Synchronize shared state across your users, including online status and typing indicators. [Docs](/docs/guides/realtime#presence).
+
+### Client libraries
+
+Official client libraries for [JavaScript](/docs/reference/javascript/) and [Dart](/docs/reference/dart).
+Unofficial libraries [supported by the community](https://github.com/supabase-community#client-libraries).
+
+
+
+## Storage
+
+### File storage
+
+Supabase Storage makes it simple to store and serve files. [Docs](/docs/guides/storage).
+
+### Storage CDN
+
+Cache large files using the Supabase CDN. [Docs](/docs/guides/storage-cdn).
+
+### Image Transformations
+
+Transform images on the fly. [Docs](/docs/guides/storage/image-transformations).
+
+
+
+## Edge Functions
+
+### Deno Edge Functions
+
+Globally distributed TypeScript functions to execute custom business logic. [Docs](/docs/guides/functions).
+
+
+
+## Project Management
+
+### CLI
+
+Use our CLI to develop your project locally and deploy to the Supabase Platform. [Docs](/docs/reference/cli).
+
+### Management API
+
+Manage your projects programmatically. [Docs](/docs/reference/api).
+
+
+
+## Feature Status
+
+Both Postgres and the Supabase Platform are production-ready. Some tools we offer on top of Postgres are still under development.
+
+| Product | Feature | Stage |
+| -------------------------- | ---------------------- | ------- |
+| Database | Postgres | `GA` |
+| Database | Triggers | `GA` |
+| Database | Functions | `GA` |
+| Database | Extensions | `GA` |
+| Database | Full Text Search | `GA` |
+| Database | Webhooks | `alpha` |
+| Database | Point-in-Time Recovery | `alpha` |
+| Database | Vault | `alpha` |
+| Studio | | `GA` |
+| Realtime | Postgres Changes | `GA` |
+| Realtime | Broadcast | `beta` |
+| Realtime | Presence | `beta` |
+| Storage | | `GA` |
+| Storage | S3 Backend | `GA` |
+| Storage | CDN | `GA` |
+| Storage | Smart CDN | `beta` |
+| Storage | Image Transformations | `beta` |
+| Edge Functions | | `beta` |
+| Auth | OAuth Providers | `beta` |
+| Auth | Passwordless | `beta` |
+| Auth | Next.js Auth Helpers | `alpha` |
+| Auth | SvelteKit Auth Helpers | `alpha` |
+| Auth | Remix Auth Helpers | `alpha` |
+| Management API | | `beta` |
+| CLI | | `beta` |
+| Client Library: JavaScript | | `GA` |
+| Client Library: Dart | | `beta` |
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
index a0770366dff..b0d5fc21c93 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-angular.mdx'
export const meta = {
id: 'with-angular',
@@ -8,11 +7,536 @@ export const meta = {
sidebar_label: 'Angular',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+
+
+
+
+### GitHub
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management).
+
+
+
+## Building the App
+
+Let's start building the Angular app from scratch.
+
+### Initialize an Angular app
+
+We can use the [Angular CLI](https://angular.io/cli) to initialize
+an app called `supabase-angular`:
+
+```bash
+npx ng new supabase-angular --routing false --style css
+cd supabase-angular
+```
+
+Then let's install the only additional dependency: [supabase-js](https://github.com/supabase/supabase-js)
+
+```bash
+npm install @supabase/supabase-js
+```
+
+And finally we want to save the environment variables in the `environment.ts` file.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+These variables will be exposed on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+
+```ts title=environment.ts
+export const environment = {
+ production: false,
+ supabaseUrl: 'YOUR_SUPABASE_URL',
+ supabaseKey: 'YOUR_SUPABASE_KEY',
+}
+```
+
+Now that we have the API credentials in place, let's create a **SupabaseService** with `ng g s supabase` to initialize the Supabase client and implement functions to communicate with the Supabase API.
+
+```ts title=src/app/supabase.service.ts
+import { Injectable } from '@angular/core'
+import {
+ AuthChangeEvent,
+ AuthSession,
+ createClient,
+ Session,
+ SupabaseClient,
+ User,
+} from '@supabase/supabase-js'
+import { environment } from 'src/environments/environment'
+import { Database } from 'src/schema'
+
+export interface Profile {
+ id?: string
+ username: string
+ website: string
+ avatar_url: string
}
+@Injectable({
+ providedIn: 'root',
+})
+export class SupabaseService {
+ private supabase: SupabaseClient
+ _session: AuthSession | null = null
+
+ constructor() {
+ this.supabase = createClient(environment.supabaseUrl, environment.supabaseKey)
+ }
+
+ get session() {
+ this.supabase.auth.getSession().then(({ data }) => {
+ this._session = data.session
+ })
+ return this._session
+ }
+
+ profile(user: User) {
+ return this.supabase
+ .from('profiles')
+ .select(`username, website, avatar_url`)
+ .eq('id', user.id)
+ .single()
+ }
+
+ authChanges(callback: (event: AuthChangeEvent, session: Session | null) => void) {
+ return this.supabase.auth.onAuthStateChange(callback)
+ }
+
+ signIn(email: string) {
+ return this.supabase.auth.signInWithOtp({ email })
+ }
+
+ signOut() {
+ return this.supabase.auth.signOut()
+ }
+
+ updateProfile(profile: Profile) {
+ const update = {
+ ...profile,
+ updated_at: new Date(),
+ }
+
+ return this.supabase.from('profiles').upsert(update)
+ }
+
+ downLoadImage(path: string) {
+ return this.supabase.storage.from('avatars').download(path)
+ }
+
+ uploadAvatar(filePath: string, file: File) {
+ return this.supabase.storage.from('avatars').upload(filePath, file)
+ }
+}
+```
+
+Optionally, update [src/styles.css](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/angular-user-management/src/styles.css) to style the app.
+
+### Set up a Login component
+
+Let's set up an Angular component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+Create an **AuthComponent** with `ng g c auth` Angular CLI command.
+
+```ts title=src/app/auth/auth.component.ts
+import { Component, OnInit } from '@angular/core'
+import { FormBuilder } from '@angular/forms'
+import { SupabaseService } from '../supabase.service'
+
+@Component({
+ selector: 'app-auth',
+ templateUrl: './auth.component.html',
+ styleUrls: ['./auth.component.css'],
+})
+export class AuthComponent implements OnInit {
+ loading = false
+
+ signInForm = this.formBuilder.group({
+ email: '',
+ })
+
+ constructor(
+ private readonly supabase: SupabaseService,
+ private readonly formBuilder: FormBuilder
+ ) {}
+
+ ngOnInit(): void {}
+
+ async onSubmit(): Promise {
+ try {
+ this.loading = true
+ const email = this.signInForm.value.email as string
+ const { error } = await this.supabase.signIn(email)
+ if (error) throw error
+ alert('Check your email for the login link!')
+ } catch (error) {
+ if (error instanceof Error) {
+ alert(error.message)
+ }
+ } finally {
+ this.signInForm.reset()
+ this.loading = false
+ }
+ }
+}
+```
+
+```html title=src/app/auth/auth.component.html
+
+
+
+ );
+}
+```
+
+### Launch!
+
+Now that we have all the components in place, let's update `App.tsx`:
+
+```jsx title=src/App.tsx
+import { Redirect, Route } from 'react-router-dom'
+import { IonApp, IonRouterOutlet, setupIonicReact } from '@ionic/react'
+import { IonReactRouter } from '@ionic/react-router'
+import { supabase } from './supabaseClient'
+
+import '@ionic/react/css/ionic.bundle.css'
+
+/* Theme variables */
+import './theme/variables.css'
+import { LoginPage } from './pages/Login'
+import { AccountPage } from './pages/Account'
+import { useEffect, useState } from 'react'
+import { Session } from '@supabase/supabase-js'
+
+setupIonicReact()
+
+const App: React.FC = () => {
+ const [session, setSession] = useState < Session > null
+ useEffect(() => {
+ setSession(supabase.auth.session())
+ supabase.auth.onAuthStateChange((_event, session) => {
+ setSession(session)
+ })
+ }, [])
+ return (
+
+
+
+ {
+ return session ? :
+ }}
+ />
+
+
+
+
+
+
+ )
}
+export default App
+```
+
+Once that's done, run this in a terminal window:
+
+```bash
+ionic serve
+```
+
+And then open the browser to [localhost:3000](http://localhost:3000) and you should see the completed app.
+
+
+
+## Bonus: Profile photos
+
+Every Supabase project is configured with [Storage](/docs/guides/storage) for managing large files like photos and videos.
+
+### Create an upload widget
+
+First install two packages in order to interact with the user's camera.
+
+```bash
+npm install @ionic/pwa-elements @capacitor/camera
+```
+
+[CapacitorJS](https://capacitorjs.com) is a cross platform native runtime from Ionic that enables web apps to be deployed through the app store and provides access to native deavice API.
+
+Ionic PWA elements is a companion package that will polyfill certain browser APIs that provide no user interface with custom Ionic UI.
+
+With those packages installed we can update our `index.tsx` to include an additional bootstapping call for the Ionic PWA Elements.
+
+```ts title=src/index.tsx
+import React from 'react'
+import ReactDOM from 'react-dom'
+import App from './App'
+import * as serviceWorkerRegistration from './serviceWorkerRegistration'
+import reportWebVitals from './reportWebVitals'
+
+import { defineCustomElements } from '@ionic/pwa-elements/loader'
+defineCustomElements(window)
+
+ReactDOM.render(
+
+
+ ,
+ document.getElementById('root')
+)
+
+serviceWorkerRegistration.unregister()
+reportWebVitals()
+```
+
+Then create an **AvatarComponent**.
+
+```jsx title=src/components/Avatar.tsx
+import { IonIcon } from '@ionic/react';
+import { person } from 'ionicons/icons';
+import { Camera, CameraResultType } from '@capacitor/camera';
+import { useEffect, useState } from 'react';
+import { supabase } from '../supabaseClient';
+import './Avatar.css'
+export function Avatar({
+ url,
+ onUpload,
+}: {
+ url: string;
+ onUpload: (e: any, file: string) => Promise;
+}) {
+ const [avatarUrl, setAvatarUrl] = useState();
+
+ useEffect(() => {
+ if (url) {
+ downloadImage(url);
+ }
+ }, [url]);
+ const uploadAvatar = async () => {
+ try {
+ const photo = await Camera.getPhoto({
+ resultType: CameraResultType.DataUrl,
+ });
+
+ const file = await fetch(photo.dataUrl!)
+ .then((res) => res.blob())
+ .then(
+ (blob) =>
+ new File([blob], 'my-file', { type: `image/${photo.format}` })
+ );
+
+ const fileName = `${Math.random()}-${new Date().getTime()}.${
+ photo.format
+ }`;
+ let { error: uploadError } = await supabase.storage
+ .from('avatars')
+ .upload(fileName, file);
+ if (uploadError) {
+ throw uploadError;
+ }
+ onUpload(null, fileName);
+ } catch (error) {
+ console.log(error);
+ }
+ };
+
+ const downloadImage = async (path: string) => {
+ try {
+ const { data, error } = await supabase.storage
+ .from('avatars')
+ .download(path);
+ if (error) {
+ throw error;
+ }
+ const url = URL.createObjectURL(data!);
+ setAvatarUrl(url);
+ } catch (error: any) {
+ console.log('Error downloading image: ', error.message);
+ }
+ };
+
+ return (
+
+
+ {avatarUrl ? (
+
+ ) : (
+
+ )}
+
+
+
+ );
+}
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```jsx title=src/pages/Account.tsx
+// Import the new component
+
+import { Avatar } from '../components/Avatar';
+
+// ...
+return (
+
+
+
+ Account
+
+
+
+
+
+```
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
+
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
index bbc32e339d4..2f368771b78 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-ionic-vue.mdx'
export const meta = {
id: 'with-ionic-vue',
@@ -8,11 +7,561 @@ export const meta = {
sidebar_label: 'Ionic Vue',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
+
+
+
+
+### GitHub
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-vue).
+
+
+
+## Building the App
+
+Let's start building the Vue app from scratch.
+
+### Initialize an Ionic Vue app
+
+We can use the [Ionic CLI](https://ionicframework.com/docs/cli) to initialize
+an app called `supabase-ionic-vue`:
+
+```bash
+npm install -g @ionic/cli
+ionic start supabase-ionic-vue blank --type vue
+cd supabase-ionic-vue
+```
+
+Then let's install the only additional dependency: [supabase-js](https://github.com/supabase/supabase-js)
+
+```bash
+npm install @supabase/supabase-js
+```
+
+And finally we want to save the environment variables in a `.env`.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env
+VUE_APP_SUPABASE_URL=YOUR_SUPABASE_URL
+VUE_APP_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
+```
+
+Now that we have the API credentials in place, let's create a helper file to initialize the Supabase client. These variables will be exposed
+on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+
+```js title=src/supabase.ts"
+import { createClient } from '@supabase/supabase-js';
+
+const supabaseUrl = process.env.VUE_APP_SUPABASE_URL as string;
+const supabaseAnonKey = process.env.VUE_APP_SUPABASE_ANON_KEY as string;
+
+export const supabase = createClient(supabaseUrl, supabaseAnonKey);
+```
+
+### Set up a Login route
+
+Let's set up a Vue component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+
+```html title=/src/views/Login.vue
+
+
+
+
+ Login
+
+
+
+
+
+
Supabase + Ionic Vue
+
Sign in via magic link with your email below
+
+
+
+
+
{{email}}
+
+
+
+
+
+```
+
+### Account page
+
+After a user is signed in we can allow them to edit their profile details and manage their account.
+
+Let's create a new component for that called `Account.vue`.
+
+```html title=src/views/Account.vue
+
+
+
+
+ Account
+
+
+
+
+
+
+
+ Log Out
+
+
+
+
+
+
+```
+
+### Launch!
+
+Now that we have all the components in place, let's update `App.vue` and our routes:
+
+```ts title=src/router.index.ts
+import { createRouter, createWebHistory } from '@ionic/vue-router'
+import { RouteRecordRaw } from 'vue-router'
+import LoginPage from '../views/Login.vue'
+import AccountPage from '../views/Account.vue'
+const routes: Array = [
+ {
+ path: '/',
+ name: 'Login',
+ component: LoginPage,
+ },
+ {
+ path: '/account',
+ name: 'Account',
+ component: AccountPage,
+ },
+]
+
+const router = createRouter({
+ history: createWebHistory(process.env.BASE_URL),
+ routes,
+})
+
+export default router
+```
+
+```html title=src/App.vue
+
+
+
+
+
+
+
+```
+
+Once that's done, run this in a terminal window:
+
+```bash
+ionic serve
+```
+
+And then open the browser to [localhost:3000](http://localhost:3000) and you should see the completed app.
+
+
+
+## Bonus: Profile photos
+
+Every Supabase project is configured with [Storage](/docs/guides/storage) for managing large files like photos and videos.
+
+### Create an upload widget
+
+First install two packages in order to interact with the user's camera.
+
+```bash
+npm install @ionic/pwa-elements @capacitor/camera
+```
+
+[CapacitorJS](https://capacitorjs.com) is a cross platform native runtime from Ionic that enables web apps to be deployed through the app store and provides access to native deavice API.
+
+Ionic PWA elements is a companion package that will polyfill certain browser APIs that provide no user interface with custom Ionic UI.
+
+With those packages installed we can update our `main.ts` to include an additional bootstapping call for the Ionic PWA Elements.
+
+```ts title=src/main.tsx"
+import { createApp } from 'vue'
+import App from './App.vue'
+import router from './router'
+
+import { IonicVue } from '@ionic/vue'
+/* Core CSS required for Ionic components to work properly */
+import '@ionic/vue/css/ionic.bundle.css'
+
+/* Theme variables */
+import './theme/variables.css'
+
+import { defineCustomElements } from '@ionic/pwa-elements/loader'
+defineCustomElements(window)
+const app = createApp(App).use(IonicVue).use(router)
+
+router.isReady().then(() => {
+ app.mount('#app')
+})
+```
+
+Then create an **AvatarComponent**.
+
+```html title=src/components/Avatar.vue
+
+
+
+
+
+
+
+
+
+
+
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```html title=src/views/Account.vue
+
+
+
+
+ Account
+
+
+
+
+
+...
+
+
+```
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
index 77564737ca7..df4d8171a4d 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import OldContent from '~/pages/guides/with-nextjs.mdx'
export const meta = {
id: 'with-nextjs',
@@ -8,11 +7,726 @@ export const meta = {
sidebar_label: 'Next.js',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return OldContent()
- }
- return
+
+
+
+
+### Video Guide
+
+
+
+
+
+### GitHub
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management).
+
+
+
+## Building the App
+
+Let's start building the Next.js app from scratch.
+
+### Initialize a Next.js app
+
+We can use [`create-next-app`](https://nextjs.org/docs/getting-started) to initialize
+an app called `supabase-nextjs`:
+
+
+
+
+```bash
+npx create-next-app@latest --use-npm supabase-nextjs
+cd supabase-nextjs
+```
+
+
+
+
+```bash
+npx create-next-app@latest --ts --use-npm supabase-nextjs
+cd supabase-nextjs
+```
+
+
+
+
+Then install the Supabase client library: [supabase-js](https://github.com/supabase/supabase-js)
+
+```bash
+npm install @supabase/supabase-js
+```
+
+And finally we want to save the environment variables in a `.env.local`.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env.local
+NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL
+NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
+```
+
+And one optional step is to update the CSS file `styles/globals.css` to make the app look nice.
+You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/nextjs-ts-user-management/styles/globals.css).
+
+### Set up a Login component
+
+#### Supabase Auth Helpers
+
+Next.js is a highly versatile framework offering pre-rendering at build time (SSG), server-side rendering at request time (SSR), API routes, and middleware edge-functions.
+
+It can be challenging to authenticate your users in all these different environments, that's why we've created the [Supabase Auth Helpers](/docs/guides/auth/auth-helpers/nextjs) to make user management and data fetching within Next.js as easy as possible.
+
+Install the auth helpers for React and Next.js
+
+```bash
+npm install @supabase/auth-helpers-react @supabase/auth-helpers-nextjs
+```
+
+
+
+
+Wrap your `pages/_app.js` component with the `SessionContextProvider` component:
+
+```jsx title=pages/_app.js
+import '../styles/globals.css'
+import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs'
+import { SessionContextProvider } from '@supabase/auth-helpers-react'
+
+function MyApp({ Component, pageProps }) {
+ const [supabase] = useState(() => createBrowserSupabaseClient())
+
+ return (
+
+
+
+ )
+}
+export default MyApp
+```
+
+
+
+
+Wrap your `pages/_app.tsx` component with the `SessionContextProvider` component:
+
+```jsx lines=2,8 title=pages/_app.tsx
+import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs'
+import { SessionContextProvider, Session } from '@supabase/auth-helpers-react'
+
+function MyApp({
+ Component,
+ pageProps,
+}: AppProps<{
+ initialSession: Session,
+}>) {
+ const [supabase] = useState(() => createBrowserSupabaseClient())
+
+ return (
+
+
+
+ )
+}
+export default MyApp
+```
+
+See the [Auth Helpers docs](/docs/guides/auth/auth-helpers/nextjs#usage-with-typescript) for more details on usage with TypeScript.
+
+
+
+
+#### Supabase Auth UI
+
+We can use the [Supabase Auth UI](/docs/guides/auth/auth-helpers/auth-ui) a pre-built React component for authenticating users via OAuth, email, and magic links.
+
+Install the Supabase Auth UI for React
+
+```bash
+npm install @supabase/auth-ui-react
+```
+
+Add the `Auth` component to your home page
+
+```jsx title=pages/index.js
+import { Auth, ThemeSupa } from '@supabase/auth-ui-react'
+import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'
+
+const Home = () => {
+ const session = useSession()
+ const supabase = useSupabaseClient()
+
+ return (
+
+ {!session ? (
+
+ ) : (
+
Account page will go here.
+ )}
+
+ )
}
+export default Home
+```
+
+### Account page
+
+After a user is signed in we can allow them to edit their profile details and manage their account.
+
+
+
+
+Let's create a new component for that called `Account.js` within a `components` folder.
+
+```tsx title=components/Account.js
+import { useState, useEffect } from 'react'
+import { useUser, useSupabaseClient } from '@supabase/auth-helpers-react'
+
+export default function Account({ session }) {
+ const supabase = useSupabaseClient()
+ const user = useUser()
+ const [loading, setLoading] = useState(true)
+ const [username, setUsername] = useState(null)
+ const [website, setWebsite] = useState(null)
+ const [avatar_url, setAvatarUrl] = useState(null)
+
+ useEffect(() => {
+ getProfile()
+ }, [session])
+
+ async function getProfile() {
+ try {
+ setLoading(true)
+
+ let { data, error, status } = await supabase
+ .from('profiles')
+ .select(`username, website, avatar_url`)
+ .eq('id', user.id)
+ .single()
+
+ if (error && status !== 406) {
+ throw error
+ }
+
+ if (data) {
+ setUsername(data.username)
+ setWebsite(data.website)
+ setAvatarUrl(data.avatar_url)
+ }
+ } catch (error) {
+ alert('Error loading user data!')
+ console.log(error)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ async function updateProfile({ username, website, avatar_url }) {
+ try {
+ setLoading(true)
+
+ const updates = {
+ id: user.id,
+ username,
+ website,
+ avatar_url,
+ updated_at: new Date().toISOString(),
+ }
+
+ let { error } = await supabase.from('profiles').upsert(updates)
+ if (error) throw error
+ alert('Profile updated!')
+ } catch (error) {
+ alert('Error updating the data!')
+ console.log(error)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ return (
+
+ )
+}
+```
+
+
+
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```jsx title=components/Account.js
+// Import the new component
+import Avatar from './Avatar'
+
+// ...
+
+return (
+
+ {/* Add to the body */}
+ {
+ setAvatarUrl(url)
+ updateProfile({ username, website, avatar_url: url })
+ }}
+ />
+ {/* ... */}
+
+)
+```
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- See the complete [example on GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management) and deploy it to Vercel.
+- Explore the [pre-built Auth UI for React](/docs/guides/auth/auth-helpers/auth-ui).
+- Explore the [Auth Helpers for Next.js](/docs/guides/auth/auth-helpers/nextjs).
+- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers).
+- See the [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub.
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
+
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
index f5f452b09e7..b4f5af0a1a3 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-nuxt-3.mdx'
export const meta = {
id: 'with-nuxt-3',
@@ -8,11 +7,426 @@ export const meta = {
sidebar_label: 'Nuxt 3',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
+
+
+
+
+### Github
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/nuxt3-user-management).
+
+
+
+## Building the App
+
+Let's start building the Vue 3 app from scratch.
+
+### Initialize a Nuxt 3 app
+
+We can use [`nuxi init`](https://v3.nuxtjs.org/getting-started/quick-start/) to create an app called `nuxt-user-management`:
+
+```bash
+npx nuxi init nuxt-user-management
+
+cd nuxt-user-management
+```
+
+Then let's install the only additional dependency: [NuxtSupabase](https://supabase.nuxtjs.org/). We only need to import NuxtSupabase as a dev dependency.
+
+```bash
+npm install @nuxtjs/supabase --save-dev
+```
+
+And finally we want to save the environment variables in a `.env`.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env
+SUPABASE_URL="YOUR_SUPABASE_URL"
+SUPABASE_KEY="YOUR_SUPABASE_ANON_KEY"
+```
+
+These variables will be exposed on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+Amazing thing about [NuxtSupabase](https://supabase.nuxtjs.org/) is that setting environment variables is all we need to do in order to start using Supabase.
+No need to initialize Supabase. The library will take care of it automatically.
+
+And one optional step is to update the CSS file `assets/main.css` to make the app look nice.
+You can find the full contents of this file [here](https://github.com/supabase-community/nuxt3-quickstarter/blob/main/assets/main.css).
+
+```typescript title=nuxt.config.ts
+import { defineNuxtConfig } from 'nuxt'
+
+// https://v3.nuxtjs.org/api/configuration/nuxt.config
+export default defineNuxtConfig({
+ modules: ['@nuxtjs/supabase'],
+ css: ['@/assets/main.css'],
+})
+```
+
+### Set up Auth component
+
+Let's set up a Vue component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+
+```html title=/components/Auth.vue
+
+
+
+
+
+```
+
+### User state
+
+To access the user information, use the composable [useSupabaseUser](https://supabase.nuxtjs.org/usage/composables/use-supabase-user) provided by the Supabase Nuxt module.
+
+### Account component
+
+After a user is signed in we can allow them to edit their profile details and manage their account.
+Let's create a new component for that called `Account.vue`.
+
+```html title=components/Account.vue
+
+
+
+
+
+```
+
+### Launch!
+
+Now that we have all the components in place, let's update `app.vue`:
+
+```html title=app.vue
+
+
+
+
+
+
+
+
+```
+
+Once that's done, run this in a terminal window:
+
+```bash
+npm run dev
+```
+
+And then open the browser to [localhost:3000](http://localhost:3000) and you should see the completed app.
+
+
+
+## Bonus: Profile photos
+
+Every Supabase project is configured with [Storage](/docs/guides/storage) for managing large files like photos and videos.
+
+### Create an upload widget
+
+Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component:
+
+```html title=components/Avatar.vue
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```html title=components/Account.vue
+
+
+
+
+
+```
+
+That is it! You should now be able to upload a profile photo to Supabase Storage.
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
index 58e435bab29..1f7804f15ab 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-react.mdx'
export const meta = {
id: 'with-react',
@@ -8,11 +7,397 @@ export const meta = {
sidebar_label: 'React',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
+
+
+
+
+### GitHub
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/react-user-management).
+
+
+
+## Building the App
+
+Let's start building the React app from scratch.
+
+### Initialize a React app
+
+We can use [Create React App](https://create-react-app.dev/docs/getting-started/) to initialize
+an app called `supabase-react`:
+
+```bash
+npx create-react-app supabase-react
+cd supabase-react
+```
+
+Then let's install the only additional dependency: [supabase-js](https://github.com/supabase/supabase-js).
+
+```bash
+npm install @supabase/supabase-js
+```
+
+And finally we want to save the environment variables in a `.env`.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env
+REACT_APP_SUPABASE_URL=YOUR_SUPABASE_URL
+REACT_APP_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
+```
+
+Now that we have the API credentials in place, let's create a helper file to initialize the Supabase client. These variables will be exposed
+on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+
+```js title=src/supabaseClient.js
+import { createClient } from '@supabase/supabase-js'
+
+const supabaseUrl = process.env.REACT_APP_SUPABASE_URL
+const supabaseAnonKey = process.env.REACT_APP_SUPABASE_ANON_KEY
+
+export const supabase = createClient(supabaseUrl, supabaseAnonKey)
+```
+
+And one optional step is to update the CSS file `src/index.css` to make the app look nice.
+You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/react-user-management/src/index.css).
+
+### Set up a Login component
+
+Let's set up a React component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+
+```jsx title=src/Auth.js
+import { useState } from 'react'
+import { supabase } from './supabaseClient'
+
+export default function Auth() {
+ const [loading, setLoading] = useState(false)
+ const [email, setEmail] = useState('')
+
+ const handleLogin = async (e) => {
+ e.preventDefault()
+
+ try {
+ setLoading(true)
+ const { error } = await supabase.auth.signInWithOtp({ email })
+ if (error) throw error
+ alert('Check your email for the login link!')
+ } catch (error) {
+ alert(error.error_description || error.message)
+ } finally {
+ setLoading(false)
+ }
}
- return
+
+ return (
+
+ )
+}
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```jsx title=src/Account.js
+// Import the new component
+import Avatar from './Avatar'
+
+// ...
+
+return (
+
+ {/* Add to the body */}
+ {
+ setAvatarUrl(url)
+ updateProfile({ username, website, avatar_url: url })
+ }}
+ />
+ {/* ... */}
+
+)
+```
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+
+export const Page = ({ children }) =>
+
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
index 1d044ed13f5..cae8504a010 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-redwoodjs.mdx'
export const meta = {
id: 'with-redwoodjs',
@@ -8,11 +7,779 @@ export const meta = {
sidebar_label: 'RedwoodJS',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
- }
- return
+## Intro
+
+For the sake of consistency with the other framework Quickstart examples, we'll build a RedwoodJS a little differently than normal.
+
+We **_won't use_** Prisma to connect to the Supabase Postgres database or [Prisma migrations](https://redwoodjs.com/docs/cli-commands#prisma-migrate) as one typically might in a Redwood app.
+Instead, we'll rely on the Supabase client to do some of the work on the **web** side and use the client again on the **API** side to do data fetching as well.
+
+That means you will want to refrain from running any `yarn rw prisma migrate` commands and also double check your build commands on deployment to ensure Prisma won't reset your database.
+
+
+
+TLDR; Prisma currently doesn't support cross-schema foreign keys, so introspecting the schema fails due to how your Supabase `public` schema references the `auth.users`.
+
+
+
+This example provides the steps to build a simple user management app (from scratch!) using Supabase and [RedwoodJS](https://redwoodjs.com/docs/introduction). It includes:
+
+- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.
+- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).
+- Supabase [Storage](/docs/guides/storage): users can upload a photo.
+- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.
+- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.
+
+By the end of this guide you'll have an app which allows users to login and update some basic profile details:
+
+
+
+
+
+Note: For RedwoodJS apps, port will be 8910
+
+
+
+### GitHub
+
+If you get stuck at any point, take a look at [this repo](https://github.com/redwoodjs/redwoodjs-supabase-quickstart).
+
+{/* ## Video demo */}
+
+{/* Coming soon. */}
+
+{/* Use the annotated timeline to step through this tutorial. */}
+
+{/* ## Instant deploy */}
+
+{/* Want to deploy a completed version of this example without following the guide? */}
+
+{/* [](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Freact-user-management&project-name=supabase-user-management&repository-name=supabase-user-management&demo-title=Supabase%20User%20Management&demo-description=An%20example%20web%20app%20using%20Supabase%20and%20Next.js&demo-url=https%3A%2F%2Fsupabase-react-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management) */}
+
+{/* Clicking this button the application will: */}
+
+{/* - Launch and prepare the Postgres database in Supabase. */}
+{/* - Launch the app in Vercel. */}
+{/* - Fork the example into your own GitHub account. */}
+{/* - Prepare the deployed application with all the necessary environment variables. */}
+
+{/* If you want to do it yourself, let's get started:` */}
+
+## About RedwoodJS
+
+A Redwood application is split into two parts: a frontend and a backend. This is represented as two node projects within a single monorepo.
+
+The frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides"**, i.e. the "web side" and the "api side".
+They are separate projects because code on the `web side` will end up running in the user's browser while code on the `api side` will run on a server somewhere.
+
+
+
+Important: When this guide refers to "API", that means the Supabase API and when it refers to "api side", that means the RedwoodJS `api side`.
+
+
+
+The **`api side`** is an implementation of a GraphQL API. The business logic is organized into "services" that represent their own internal API and can be called both from external GraphQL requests and other internal services.
+
+The **`web side`** is built with React. Redwood's router makes it simple to map URL paths to React "Page" components (and automatically code-split your app on each route).
+Pages may contain a "Layout" component to wrap content. They also contain "Cells" and regular React components.
+Cells allow you to declaratively manage the lifecycle of a component that fetches and displays data.
+
+
+
+For the sake of consistency with the other framework Quickstart examples, we'll build a RedwoodJS a little differently than normal.
+We **_won't use_** Prisma to connect to the Supabase Postgres database or [Prisma migrations](https://redwoodjs.com/docs/cli-commands#prisma-migrate) as one typically might in a Redwood app.
+Instead, we'll rely on the Supabase client to do some of the work on the **`web`** side and use the client again on the **`api`** side to do data fetching as well.
+
+
+
+## Project set up
+
+Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase
+and then creating a "schema" inside the database.
+
+
+
+When setting up Supabase, you'll interact with your project dashboard. However, most of the RedwoodJS setup steps will interact with the [Redwood CLI](https://redwoodjs.com/docs/cli-commands) to generate routes, pages, components, and more.
+So be sure to have a terminal at the ready and in your project directory.
+
+
+
+### Create a project
+
+1. Go to [app.supabase.com](https://app.supabase.com).
+1. Click on "New Project".
+1. Enter your project details.
+1. Wait for the new database to launch.
+
+### Set up the database schema
+
+Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor,
+or you can just copy/paste the SQL from below and run it yourself.
+
+
+
+
+1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.
+2. Click **User Management Starter**.
+3. Click **Run**.
+
+
+
+
+
+
+```sql
+-- Create a table for public "profiles"
+create table profiles (
+ id uuid references auth.users not null,
+ updated_at timestamp with time zone,
+ username text unique,
+ avatar_url text,
+ website text,
+
+ primary key (id),
+ unique(username),
+ constraint username_length check (char_length(username) >= 3)
+);
+
+alter table profiles enable row level security;
+
+create policy "Public profiles are viewable by everyone."
+ on profiles for select
+ using ( true );
+
+create policy "Users can insert their own profile."
+ on profiles for insert
+ with check ( auth.uid() = id );
+
+create policy "Users can update own profile."
+ on profiles for update
+ using ( auth.uid() = id );
+
+-- Set up Realtime!
+begin;
+ drop publication if exists supabase_realtime;
+ create publication supabase_realtime;
+commit;
+alter publication supabase_realtime add table profiles;
+
+-- Set up Storage!
+insert into storage.buckets (id, name)
+values ('avatars', 'avatars');
+
+create policy "Avatar images are publicly accessible."
+ on storage.objects for select
+ using ( bucket_id = 'avatars' );
+
+create policy "Anyone can upload an avatar."
+ on storage.objects for insert
+ with check ( bucket_id = 'avatars' );
+
+```
+
+
+
+
+#### Important Note about Prisma and Migrations
+
+
+
+Because this Quick Start does not use Prisma to manage the database schema, seed it, or run migrations, you **need** to take extra care when running some of the typical Redwood CLI commands.
+
+
+
+### Get the API Keys
+
+Now that you've created some database tables, you are ready to insert data using the auto-generated API.
+We just need to get the URL as well as the `anon`, `service_role` and `JWT_SECRET` keys from the API settings.
+
+1. Go to the [API Settings](https://app.supabase.com/project/_/settings/api) page in the Dashboard.
+2. Find your API `URL`, `anon`, and `service_role` keys on this page.
+
+
+
+## Building the App
+
+Let's start building the RedwoodJS app from scratch.
+
+
+
+RedwoodJS requires Node.js `>= 14.x <= 16.x` and Yarn `>= 1.15`.
+
+
+
+Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides".
+
+### Initialize a RedwoodJS app
+
+We can use [Create Redwood App](https://redwoodjs.com/docs/quick-start) command to initialize
+an app called `supabase-redwoodjs`:
+
+```bash
+yarn create redwood-app supabase-redwoodjs
+cd supabase-redwoodjs
+```
+
+While the app is installing, you should see:
+
+```bash
+✔ Creating Redwood app
+ ✔ Checking node and yarn compatibility
+ ✔ Creating directory 'supabase-redwoodjs'
+✔ Installing packages
+ ✔ Running 'yarn install'... (This could take a while)
+✔ Convert TypeScript files to JavaScript
+✔ Generating types
+
+Thanks for trying out Redwood!
+```
+
+Then let's install the only additional dependency [supabase-js](https://github.com/supabase/supabase-js) by running the `setup auth` command:
+
+```bash
+yarn redwood setup auth supabase
+```
+
+When prompted:
+
+> Overwrite existing /api/src/lib/auth.[jt]s?
+
+Say, **yes** and it will setup the Supabase client in your app and also provide hooks used with Supabase authentication.
+
+```bash
+✔ Generating auth lib...
+ ✔ Successfully wrote file `./api/src/lib/auth.js`
+ ✔ Adding auth config to web...
+ ✔ Adding auth config to GraphQL API...
+ ✔ Adding required web packages...
+ ✔ Installing packages...
+ ✔ One more thing...
+
+ You will need to add your Supabase URL (SUPABASE_URL), public API KEY,
+ and JWT SECRET (SUPABASE_KEY, and SUPABASE_JWT_SECRET) to your .env file.
+```
+
+Next, we want to save the environment variables in a `.env`.
+We need the `API URL` as well as the `anon` and `jwt_secret` keys that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env
+SUPABASE_URL=YOUR_SUPABASE_URL
+SUPABASE_KEY=YOUR_SUPABASE_ANON_KEY
+SUPABASE_JWT_SECRET=YOUR_SUPABASE_JWT_SECRET
+```
+
+And finally, you will also need to save **just** the `web side` environment variables to the `redwood.toml`.
+
+```bash title=redwood.toml
+[web]
+ title = "Supabase Redwood Quickstart"
+ port = 8910
+ apiProxyPath = "/.redwood/functions"
+ includeEnvironmentVariables = ["SUPABASE_URL", "SUPABASE_KEY"]
+[api]
+ port = 8911
+[browser]
+ open = true
+```
+
+These variables will be exposed on the browser, and that's completely fine.
+They allow your web app to initialize the Supabase client with your public anon key
+since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+
+You'll see these being used to configure your Supabase client in `web/src/App.js`:
+
+```js title=web/src/App.js
+// ... Redwood imports
+import { AuthProvider } from '@redwoodjs/auth'
+import { createClient } from '@supabase/supabase-js'
+
+// ...
+
+const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY)
+
+const App = () => (
+
+
+
+
+
+
+
+
+
+)
+
+export default App
+```
+
+And one optional step is to update the CSS file `web/src/index.css` to make the app look nice.
+You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/react-user-management/src/index.css).
+
+### Start RedwoodJS and your first Page
+
+Let's test our setup at the moment by starting up the app:
+
+```bash
+yarn rw dev
+```
+
+
+
+Note: You can also use the alias `rw` for `redwood`, as in `yarn rw` to run Redwood CLI commands
+
+
+
+You should see a "Welcome to RedwoodJS" page and a message about not having any pages yet.
+
+So, let's create a "home" page:
+
+```bash
+yarn rw generate page home /
+
+✔ Generating page files...
+ ✔ Successfully wrote file `./web/src/pages/HomePage/HomePage.stories.js`
+ ✔ Successfully wrote file `./web/src/pages/HomePage/HomePage.test.js`
+ ✔ Successfully wrote file `./web/src/pages/HomePage/HomePage.js`
+✔ Updating routes file...
+✔ Generating types ...
+```
+
+
+
+Note: the slash `/` is important here as it creates a root level route.
+
+
+
+You can stop the `dev` server if you want; to see your changes, just be sure to run `yarn rw dev` again.
+
+You should see the `Home` page route in `web/src/Routes.js`:
+
+```bash title=web/src/Routes.js
+import { Router, Route } from '@redwoodjs/router'
+
+const Routes = () => {
+ return (
+
+
+
+
+ )
}
+export default Routes
+```
+
+### Set up a Login component
+
+Let's set up a Redwood component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+
+```bash
+yarn rw g component auth
+
+ ✔ Generating component files...
+ ✔ Successfully wrote file `./web/src/components/Auth/Auth.test.js`
+ ✔ Successfully wrote file `./web/src/components/Auth/Auth.stories.js`
+ ✔ Successfully wrote file `./web/src/components/Auth/Auth.js`
+
+```
+
+Now, update the `Auth.js` component to contain:
+
+```jsx title=/web/src/components/Auth/Auth.js
+import { useState } from 'react'
+import { useAuth } from '@redwoodjs/auth'
+
+const Auth = () => {
+ const { logIn } = useAuth()
+ const [loading, setLoading] = useState(false)
+ const [email, setEmail] = useState('')
+
+ const handleLogin = async (email) => {
+ try {
+ setLoading(true)
+ const { error } = await logIn({ email })
+ if (error) throw error
+ alert('Check your email for the login link!')
+ } catch (error) {
+ alert(error.error_description || error.message)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ return (
+
+
+
Supabase + RedwoodJS
+
Sign in via magic link with your email below
+
+ setEmail(e.target.value)}
+ />
+
+
+
+
+
+
+ )
+}
+
+export default Auth
+```
+
+### Set up an Account component
+
+After a user is signed in we can allow them to edit their profile details and manage their account.
+
+Let's create a new component for that called `Account.js`.
+
+```bash
+yarn rw g component account
+
+ ✔ Generating component files...
+ ✔ Successfully wrote file `./web/src/components/Account/Account.test.js`
+ ✔ Successfully wrote file `./web/src/components/Account/Account.stories.js`
+ ✔ Successfully wrote file `./web/src/components/Account/Account.js`
+```
+
+And then update the file to contain:
+
+```jsx title=web/src/components/Account/Account.js
+import { useState, useEffect } from 'react'
+import { useAuth } from '@redwoodjs/auth'
+
+const Account = () => {
+ const { client: supabase, currentUser, logOut } = useAuth()
+ const [loading, setLoading] = useState(true)
+ const [username, setUsername] = useState(null)
+ const [website, setWebsite] = useState(null)
+ const [avatar_url, setAvatarUrl] = useState(null)
+
+ useEffect(() => {
+ getProfile()
+ }, [supabase.auth.session])
+
+ async function getProfile() {
+ try {
+ setLoading(true)
+ const user = supabase.auth.user()
+
+ let { data, error, status } = await supabase
+ .from('profiles')
+ .select(`username, website, avatar_url`)
+ .eq('id', user.id)
+ .single()
+
+ if (error && status !== 406) {
+ throw error
+ }
+
+ if (data) {
+ setUsername(data.username)
+ setWebsite(data.website)
+ setAvatarUrl(data.avatar_url)
+ }
+ } catch (error) {
+ alert(error.message)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ async function updateProfile({ username, website, avatar_url }) {
+ try {
+ setLoading(true)
+ const user = supabase.auth.user()
+
+ const updates = {
+ id: user.id,
+ username,
+ website,
+ avatar_url,
+ updated_at: new Date(),
+ }
+
+ let { error } = await supabase.from('profiles').upsert(updates, {
+ returning: 'minimal', // Don't return the value after inserting
+ })
+
+ if (error) {
+ throw error
+ }
+
+ alert('Updated profile!')
+ } catch (error) {
+ alert(error.message)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ return (
+
+
+
Supabase + RedwoodJS
+
Your profile
+
+
+
+
+
+
+
+ setUsername(e.target.value)}
+ />
+
+
+
+ setWebsite(e.target.value)}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default Account
+```
+
+
+
+Note: You'll see the use of `useAuth()` several times in the quickstart. Redwood's `useAuth` hook provides convenient ways to access
+logIn, logOut, currentUser, and access the `supabase` authenticate client. We'll use it to get an instance
+of the supabase client to interact with your API.
+
+
+
+### Update Home Page
+
+Now that we have all the components in place, let's update your `HomePage` page to use them:
+
+```jsx title=web/src/pages/HomePage/HomePage.js
+import { useAuth } from '@redwoodjs/auth'
+import { MetaTags } from '@redwoodjs/web'
+
+import Account from 'src/components/Account'
+import Auth from 'src/components/Auth'
+
+const HomePage = () => {
+ const { isAuthenticated } = useAuth()
+
+ return (
+ <>
+
+ {!isAuthenticated ? : }
+ >
+ )
+}
+
+export default HomePage
+```
+
+> What we're doing here is showing the sign in form if you aren't logged in and your account profile if you are.
+
+### Launch!
+
+Once that's done, run this in a terminal window to launch the `dev` server:
+
+```bash
+yarn rw dev
+```
+
+And then open the browser to [localhost:8910](http://localhost:8910) and you should see the completed app.
+
+
+
+## Bonus: Profile photos
+
+Every Supabase project is configured with [Storage](/docs/guides/storage) for managing large files like photos and videos.
+
+### Create an upload widget
+
+Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component:
+
+```bash
+yarn rw g component avatar
+ ✔ Generating component files...
+ ✔ Successfully wrote file `./web/src/components/Avatar/Avatar.test.js`
+ ✔ Successfully wrote file `./web/src/components/Avatar/Avatar.stories.js`
+ ✔ Successfully wrote file `./web/src/components/Avatar/Avatar.js`
+```
+
+Now, update your Avatar component to contain the following widget:
+
+```jsx title=web/src/components/Avatar/Avatar.js
+import { useEffect, useState } from 'react'
+import { useAuth } from '@redwoodjs/auth'
+
+const Avatar = ({ url, size, onUpload }) => {
+ const { client: supabase } = useAuth()
+
+ const [avatarUrl, setAvatarUrl] = useState(null)
+ const [uploading, setUploading] = useState(false)
+
+ useEffect(() => {
+ if (url) downloadImage(url)
+ }, [url])
+
+ async function downloadImage(path) {
+ try {
+ const { data, error } = await supabase.storage.from('avatars').download(path)
+ if (error) {
+ throw error
+ }
+ const url = URL.createObjectURL(data)
+ setAvatarUrl(url)
+ } catch (error) {
+ console.log('Error downloading image: ', error.message)
+ }
+ }
+
+ async function uploadAvatar(event) {
+ try {
+ setUploading(true)
+
+ if (!event.target.files || event.target.files.length === 0) {
+ throw new Error('You must select an image to upload.')
+ }
+
+ const file = event.target.files[0]
+ const fileExt = file.name.split('.').pop()
+ const fileName = `${Math.random()}.${fileExt}`
+ const filePath = `${fileName}`
+
+ let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+
+ if (uploadError) {
+ throw uploadError
+ }
+
+ onUpload(filePath)
+ } catch (error) {
+ alert(error.message)
+ } finally {
+ setUploading(false)
+ }
+ }
+
+ return (
+
+ {avatarUrl ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+ )
+}
+
+export default Avatar
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account component:
+
+```jsx title=web/src/components/Account/Account.js
+// Import the new component
+import Avatar from 'src/components/Avatar'
+
+// ...
+
+return (
+
+ {/* Add to the body */}
+ {
+ setAvatarUrl(url)
+ updateProfile({ username, website, avatar_url: url })
+ }}
+ />
+ {/* ... */}
+
+)
+```
+
+## Next steps
+
+At this stage you have a fully functional application!
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.com](https://app.supabase.com)
+- Learn more about [RedwoodJS](https://redwoodjs.com)
+- Visit the [RedwoodJS Discourse Community](https://community.redwoodjs.com)
+
+export const Page = ({ children }) =>
+
export default Page
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
index f03f73a8e93..f5a65665f3f 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
@@ -1,5 +1,4 @@
import Layout from '~/layouts/DefaultGuideLayout'
-import oldContent from '~/pages/guides/with-solidjs.mdx'
export const meta = {
id: 'with-solidjs',
@@ -8,11 +7,421 @@ export const meta = {
sidebar_label: 'SolidJS',
}
-export const Page = ({ children }) => {
- if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true') {
- return oldContent()
+
+
+
+
+### GitHub
+
+Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/solid-user-management).
+
+
+
+## Building the App
+
+Let's start building the SolidJS app from scratch.
+
+### Initialize a SolidJS app
+
+We can use [Degit](https://github.com/Rich-Harris/degit) to initialize an app called `supabase-solid`:
+
+```bash
+npx degit solidjs/templates/ts supabase-solid
+cd supabase-solid
+```
+
+Then let's install the only additional dependency: [supabase-js](https://github.com/supabase/supabase-js)
+
+```bash
+npm install @supabase/supabase-js
+```
+
+And finally we want to save the environment variables in a `.env`.
+All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).
+
+```bash title=.env
+VITE_SUPABASE_URL=YOUR_SUPABASE_URL
+VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
+```
+
+Now that we have the API credentials in place, let's create a helper file to initialize the Supabase client. These variables will be exposed
+on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
+
+```js title=src/supabaseClient.jsx
+import { createClient } from '@supabase/supabase-js'
+
+const supabaseUrl = import.meta.env.VITE_SUPABASE_URL
+const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY
+
+export const supabase = createClient(supabaseUrl, supabaseAnonKey)
+```
+
+And one optional step is to update the CSS file `src/index.css` to make the app look nice.
+You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/solid-user-management/src/index.css).
+
+### Set up a Login component
+
+Let's set up a SolidJS component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
+
+```jsx title=src/Auth.tsx
+import { createSignal } from 'solid-js'
+import { supabase } from './supabaseClient'
+
+export default function Auth() {
+ const [loading, setLoading] = createSignal(false)
+ const [email, setEmail] = createSignal('')
+
+ const handleLogin = async (e: SubmitEvent) => {
+ e.preventDefault()
+
+ try {
+ setLoading(true)
+ const { error } = await supabase.auth.signInWithOtp({ email: email() })
+ if (error) throw error
+ alert('Check your email for the login link!')
+ } catch (error) {
+ if (error instanceof Error) {
+ alert(error.message)
+ }
+ } finally {
+ setLoading(false)
+ }
}
- return
+
+ return (
+
+ )
+}
+
+export default Account
+```
+
+### Launch!
+
+Now that we have all the components in place, let's update `App.tsx`:
+
+```jsx title=src/App.tsx
+import { Component, createEffect, createSignal } from 'solid-js'
+import { supabase } from './supabaseClient'
+import { AuthSession } from '@supabase/supabase-js'
+import Account from './Account'
+import Auth from './Auth'
+
+const App: Component = () => {
+ const [session, setSession] = createSignal(null)
+
+ createEffect(() => {
+ supabase.auth.getSession().then(({ data: { session } }) => {
+ setSession(session)
+ })
+
+ supabase.auth.onAuthStateChange((_event, session) => {
+ setSession(session)
+ })
+ })
+
+ return (
+
+ {!session() ? : }
+
+ )
+}
+
+export default App
+```
+
+Once that's done, run this in a terminal window:
+
+```bash
+npm start
+```
+
+And then open the browser to [localhost:3000](http://localhost:3000) and you should see the completed app.
+
+
+
+## Bonus: Profile photos
+
+Every Supabase project is configured with [Storage](/docs/guides/storage) for managing large files like photos and videos.
+
+### Create an upload widget
+
+Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component:
+
+```jsx title=src/Avatar.tsx
+import { Component, createEffect, createSignal, JSX } from 'solid-js'
+import { supabase } from './supabaseClient'
+
+interface Props {
+ size: number
+ url: string | null
+ onUpload: (event: Event, filePath: string) => void
+}
+
+const Avatar: Component = (props) => {
+ const [avatarUrl, setAvatarUrl] = createSignal(null)
+ const [uploading, setUploading] = createSignal(false)
+
+ createEffect(() => {
+ if (props.url) downloadImage(props.url)
+ })
+
+ const downloadImage = async (path: string) => {
+ try {
+ const { data, error } = await supabase.storage.from('avatars').download(path)
+ if (error) {
+ throw error
+ }
+ const url = URL.createObjectURL(data)
+ setAvatarUrl(url)
+ } catch (error) {
+ if (error instanceof Error) {
+ console.log('Error downloading image: ', error.message)
+ }
+ }
+ }
+
+ const uploadAvatar: JSX.EventHandler = async (event) => {
+ try {
+ setUploading(true)
+
+ const target = event.currentTarget
+ if (!target?.files || target.files.length === 0) {
+ throw new Error('You must select an image to upload.')
+ }
+
+ const file = target.files[0]
+ const fileExt = file.name.split('.').pop()
+ const fileName = `${Math.random()}.${fileExt}`
+ const filePath = `${fileName}`
+
+ let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+
+ if (uploadError) {
+ throw uploadError
+ }
+
+ props.onUpload(event, filePath)
+ } catch (error) {
+ if (error instanceof Error) {
+ alert(error.message)
+ }
+ } finally {
+ setUploading(false)
+ }
+ }
+
+ return (
+
+ {avatarUrl() ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+ )
+}
+
+export default Avatar
+```
+
+### Add the new widget
+
+And then we can add the widget to the Account page:
+
+```jsx title=src/Account.tsx
+// Import the new component
+import Avatar from './Avatar'
+
+// ...
+
+return (
+