From 893fb1fa4e04c4eefbde8610b894f2229d054066 Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Wed, 5 Oct 2022 14:30:28 +0200
Subject: [PATCH] prettier
---
apps/reference/_api/usage.mdx | 536 +++---------------
apps/reference/_gotrue/config.mdx | 16 +-
apps/reference/_gotrue/usage.mdx | 7 +-
.../version-v1/generating-types.mdx | 20 +-
.../version-v1/index.mdx | 9 +-
.../version-v1/initializing.mdx | 70 +--
.../version-v1/installing.mdx | 11 +-
apps/reference/docs/about.mdx | 11 +-
.../docs/guides/auth/auth-helpers/index.mdx | 10 +-
.../docs/guides/auth/auth-helpers/nextjs.mdx | 2 +-
.../guides/auth/auth-helpers/sveltekit.mdx | 418 +++++++-------
.../docs/guides/cli/local-development.mdx | 2 +-
.../database/connecting-to-postgres.mdx | 7 +-
.../database/migrating-between-projects.mdx | 3 +-
apps/reference/docs/guides/functions.mdx | 18 +-
.../docs/guides/hosting/platform.mdx | 15 +-
.../docs/guides/integrations/authsignal.mdx | 3 +-
.../docs/guides/integrations/polyscale.mdx | 2 +-
.../docs/guides/migrations/firebase-auth.mdx | 28 +-
.../guides/migrations/firebase-storage.mdx | 10 +-
.../docs/guides/migrations/firestore-data.mdx | 159 +++---
.../docs/guides/migrations/heroku.mdx | 8 +-
.../docs/guides/platform/disk-usage.mdx | 1 -
apps/reference/docs/guides/platform/logs.mdx | 54 +-
.../docs/guides/realtime/broadcast.mdx | 2 +-
apps/reference/docs/guides/with-expo.mdx | 80 ++-
.../docs/guides/with-ionic-react.mdx | 2 +-
apps/reference/docs/guides/with-nuxt-3.mdx | 16 +-
apps/reference/docs/guides/with-solidjs.mdx | 20 +-
apps/reference/docs/guides/with-svelte.mdx | 66 ++-
apps/reference/docs/guides/with-sveltekit.mdx | 37 +-
apps/reference/generator/legacy.ts | 4 +-
32 files changed, 687 insertions(+), 960 deletions(-)
diff --git a/apps/reference/_api/usage.mdx b/apps/reference/_api/usage.mdx
index 09584d7a96b..26e64d10479 100644
--- a/apps/reference/_api/usage.mdx
+++ b/apps/reference/_api/usage.mdx
@@ -5,25 +5,17 @@ title: Usage
toc_max_heading_level: 3
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
-
-
-
-
-
## Organizations {#organizations}
Organization endpoints
-
-
### List all organizations {#list-all-organizations}
@@ -34,15 +26,8 @@ GET https://api.supabase.com/v1/organizations
-
-
-
-
-
-
-
#### Responses
@@ -51,11 +36,8 @@ GET https://api.supabase.com/v1/organizations
-
-
-
```json
{
"schema": {
@@ -70,16 +52,12 @@ GET https://api.supabase.com/v1/organizations
"type": "string"
}
},
- "required": [
- "id",
- "name"
- ]
+ "required": ["id", "name"]
}
}
}
```
-
@@ -90,8 +68,6 @@ Unexpected error listing organizations
-
-
@@ -100,7 +76,6 @@ Unexpected error listing organizations
-
### Create an organization {#create-an-organization}
@@ -111,14 +86,8 @@ POST https://api.supabase.com/v1/organizations
-
-
-
-
-
-
#### Body Parameters
```json
@@ -130,14 +99,11 @@ POST https://api.supabase.com/v1/organizations
"type": "string"
}
},
- "required": [
- "name"
- ]
+ "required": ["name"]
}
}
```
-
#### Responses
@@ -146,11 +112,8 @@ POST https://api.supabase.com/v1/organizations
-
-
-
```json
{
"schema": {
@@ -163,15 +126,11 @@ POST https://api.supabase.com/v1/organizations
"type": "string"
}
},
- "required": [
- "id",
- "name"
- ]
+ "required": ["id", "name"]
}
}
```
-
@@ -182,8 +141,6 @@ Unexpected error creating an organization
-
-
@@ -192,14 +149,10 @@ Unexpected error creating an organization
-
-
## Projects {#projects}
Project endpoints
-
-
### List all projects {#list-all-projects}
@@ -210,15 +163,8 @@ GET https://api.supabase.com/v1/projects
-
-
-
-
-
-
-
#### Responses
@@ -227,11 +173,8 @@ GET https://api.supabase.com/v1/projects
-
-
-
```json
{
"schema": {
@@ -255,19 +198,12 @@ GET https://api.supabase.com/v1/projects
"type": "string"
}
},
- "required": [
- "id",
- "organization_id",
- "name",
- "region",
- "created_at"
- ]
+ "required": ["id", "organization_id", "name", "region", "created_at"]
}
}
}
```
-
@@ -276,7 +212,6 @@ GET https://api.supabase.com/v1/projects
-
### Create a project {#create-a-project}
@@ -287,14 +222,8 @@ POST https://api.supabase.com/v1/projects
-
-
-
-
-
-
#### Body Parameters
```json
@@ -313,10 +242,7 @@ POST https://api.supabase.com/v1/projects
},
"plan": {
"type": "string",
- "enum": [
- "free",
- "pro"
- ]
+ "enum": ["free", "pro"]
},
"region": {
"type": "string",
@@ -339,18 +265,11 @@ POST https://api.supabase.com/v1/projects
"type": "boolean"
}
},
- "required": [
- "db_pass",
- "name",
- "organization_id",
- "plan",
- "region"
- ]
+ "required": ["db_pass", "name", "organization_id", "plan", "region"]
}
}
```
-
#### Responses
@@ -359,11 +278,8 @@ POST https://api.supabase.com/v1/projects
-
-
-
```json
{
"schema": {
@@ -385,18 +301,11 @@ POST https://api.supabase.com/v1/projects
"type": "string"
}
},
- "required": [
- "id",
- "organization_id",
- "name",
- "region",
- "created_at"
- ]
+ "required": ["id", "organization_id", "name", "region", "created_at"]
}
}
```
-
@@ -405,7 +314,6 @@ POST https://api.supabase.com/v1/projects
-
### List all functions {#list-all-functions}
@@ -416,39 +324,24 @@ GET https://api.supabase.com/v1/projects/{ref}/functions
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
-
-
-
#### Responses
@@ -457,11 +350,8 @@ GET https://api.supabase.com/v1/projects/{ref}/functions
-
-
-
```json
{
"schema": {
@@ -479,11 +369,7 @@ GET https://api.supabase.com/v1/projects/{ref}/functions
"type": "string"
},
"status": {
- "enum": [
- "ACTIVE",
- "REMOVED",
- "THROTTLED"
- ],
+ "enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
@@ -513,19 +399,14 @@ GET https://api.supabase.com/v1/projects/{ref}/functions
}
```
-
-
-
-
-
@@ -536,8 +417,6 @@ Failed to retrieve project's functions
-
-
@@ -546,7 +425,6 @@ Failed to retrieve project's functions
-
### Create a function {#create-a-function}
@@ -557,38 +435,24 @@ POST https://api.supabase.com/v1/projects/{ref}/functions
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
-
-
#### Body Parameters
```json
@@ -610,16 +474,11 @@ POST https://api.supabase.com/v1/projects/{ref}/functions
"type": "boolean"
}
},
- "required": [
- "slug",
- "name",
- "body"
- ]
+ "required": ["slug", "name", "body"]
}
}
```
-
#### Responses
@@ -628,11 +487,8 @@ POST https://api.supabase.com/v1/projects/{ref}/functions
-
-
-
```json
{
"schema": {
@@ -648,11 +504,7 @@ POST https://api.supabase.com/v1/projects/{ref}/functions
"type": "string"
},
"status": {
- "enum": [
- "ACTIVE",
- "REMOVED",
- "THROTTLED"
- ],
+ "enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
@@ -681,19 +533,14 @@ POST https://api.supabase.com/v1/projects/{ref}/functions
}
```
-
-
-
-
-
@@ -704,8 +551,6 @@ Failed to create project's function
-
-
@@ -714,7 +559,6 @@ Failed to create project's function
-
### Retrieve a function {#retrieve-a-function}
@@ -725,57 +569,34 @@ GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
- function_slug
-
-
- required
-
-
-
-
-
-
-
- Function slug
-
+
+ function_slug
+ required
+
+
+
+ Function slug
-
-
-
-
-
-
#### Responses
@@ -784,11 +605,8 @@ GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
-
-
```json
{
"schema": {
@@ -804,11 +622,7 @@ GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
"type": "string"
},
"status": {
- "enum": [
- "ACTIVE",
- "REMOVED",
- "THROTTLED"
- ],
+ "enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
@@ -840,19 +654,14 @@ GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
}
```
-
-
-
-
-
@@ -863,8 +672,6 @@ Failed to retrieve function with given slug
-
-
@@ -873,7 +680,6 @@ Failed to retrieve function with given slug
-
### Update a function {#update-a-function}
@@ -884,56 +690,34 @@ PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
- function_slug
-
-
- required
-
-
-
-
-
-
-
- Function slug
-
+
+ function_slug
+ required
+
+
+
+ Function slug
-
-
-
-
-
#### Body Parameters
```json
@@ -955,7 +739,6 @@ PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
}
```
-
#### Responses
@@ -964,11 +747,8 @@ PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
-
-
```json
{
"schema": {
@@ -984,11 +764,7 @@ PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
"type": "string"
},
"status": {
- "enum": [
- "ACTIVE",
- "REMOVED",
- "THROTTLED"
- ],
+ "enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
@@ -1017,19 +793,14 @@ PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
}
```
-
-
-
-
-
@@ -1040,8 +811,6 @@ Failed to update function with given slug
-
-
@@ -1050,7 +819,6 @@ Failed to update function with given slug
-
### Delete a function {#delete-a-function}
@@ -1061,57 +829,34 @@ DELETE https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
- function_slug
-
-
- required
-
-
-
-
-
-
-
- Function slug
-
+
+ function_slug
+ required
+
+
+
+ Function slug
-
-
-
-
-
-
#### Responses
@@ -1120,24 +865,16 @@ DELETE https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
-
-
-
-
-
-
-
-
@@ -1148,8 +885,6 @@ Failed to delete function with given slug
-
-
@@ -1158,7 +893,6 @@ Failed to delete function with given slug
-
### List all secrets {#list-all-secrets}
@@ -1169,39 +903,24 @@ GET https://api.supabase.com/v1/projects/{ref}/secrets
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
-
-
-
#### Responses
@@ -1210,11 +929,8 @@ GET https://api.supabase.com/v1/projects/{ref}/secrets
-
-
-
```json
{
"schema": {
@@ -1229,28 +945,20 @@ GET https://api.supabase.com/v1/projects/{ref}/secrets
"type": "string"
}
},
- "required": [
- "name",
- "value"
- ]
+ "required": ["name", "value"]
}
}
}
```
-
-
-
-
-
@@ -1261,8 +969,6 @@ Failed to retrieve project's secrets
-
-
@@ -1271,7 +977,6 @@ Failed to retrieve project's secrets
-
### Bulk create secrets {#bulk-create-secrets}
@@ -1282,38 +987,24 @@ POST https://api.supabase.com/v1/projects/{ref}/secrets
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
-
-
#### Body Parameters
```json
@@ -1331,16 +1022,12 @@ POST https://api.supabase.com/v1/projects/{ref}/secrets
"pattern": "/^(?!SUPABASE_).*/"
}
},
- "required": [
- "name",
- "value"
- ]
+ "required": ["name", "value"]
}
}
}
```
-
#### Responses
@@ -1349,24 +1036,16 @@ POST https://api.supabase.com/v1/projects/{ref}/secrets
-
-
-
-
-
-
-
-
@@ -1377,8 +1056,6 @@ Failed to create project's secrets
-
-
@@ -1387,7 +1064,6 @@ Failed to create project's secrets
-
### Bulk delete secrets {#bulk-delete-secrets}
@@ -1398,38 +1074,24 @@ DELETE https://api.supabase.com/v1/projects/{ref}/secrets
-
#### Path Parameters
-
-
-
- ref
-
-
- required
-
-
-
-
-
-
-
- Project ref
-
+
+ ref
+ required
+
+
+
+ Project ref
-
-
-
-
-
#### Body Parameters
```json
@@ -1443,7 +1105,6 @@ DELETE https://api.supabase.com/v1/projects/{ref}/secrets
}
```
-
#### Responses
@@ -1452,11 +1113,8 @@ DELETE https://api.supabase.com/v1/projects/{ref}/secrets
-
-
-
```json
{
"schema": {
@@ -1465,19 +1123,14 @@ DELETE https://api.supabase.com/v1/projects/{ref}/secrets
}
```
-
-
-
-
-
@@ -1488,8 +1141,6 @@ Failed to delete secrets with given names
-
-
@@ -1497,4 +1148,3 @@ Failed to delete secrets with given names
-
diff --git a/apps/reference/_gotrue/config.mdx b/apps/reference/_gotrue/config.mdx
index 9a00a5a380e..391c9378400 100644
--- a/apps/reference/_gotrue/config.mdx
+++ b/apps/reference/_gotrue/config.mdx
@@ -11,25 +11,21 @@ A `config.toml` file is generated after running `supabase init`.
This file is located in the `supabase` folder under `supabase/config.toml`.
-
-
-
## General {#general}
-
-
### `project_id` {#project_id}
A string used to distinguish different Supabase projects on the same host. Defaults to the working directory name when running `supabase init`.
-
-- Required:
true
-- Default:
None
+ -
+ Required:
true
+
+ -
+ Default:
None
+
-
-
diff --git a/apps/reference/_gotrue/usage.mdx b/apps/reference/_gotrue/usage.mdx
index 64eed5538f0..3a4a64e2d2f 100644
--- a/apps/reference/_gotrue/usage.mdx
+++ b/apps/reference/_gotrue/usage.mdx
@@ -5,14 +5,11 @@ title: Usage
toc_max_heading_level: 3
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
Documentation of the gotrue API.
-
-
diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/generating-types.mdx b/apps/reference/_supabase_js_versioned_docs/version-v1/generating-types.mdx
index 83aa820316b..033cfdb9165 100644
--- a/apps/reference/_supabase_js_versioned_docs/version-v1/generating-types.mdx
+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/generating-types.mdx
@@ -1,12 +1,12 @@
---
id: generating-types
-title: "Generating Types"
+title: 'Generating Types'
slug: generating-types
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/api/generating-types).
@@ -19,12 +19,12 @@ If you don't provide a type for the row you need to explicitly pass `from('
```ts
type Message = {
- id: number;
- inserted_at: string;
- message: string;
- user_id: string;
- channel_id: number;
- author: { username: string };
+ id: number
+ inserted_at: string
+ message: string
+ user_id: string
+ channel_id: number
+ author: { username: string }
}
const response = await supabase
@@ -39,4 +39,4 @@ const response = await supabase
.select('*, author:user_id(username)')
.match({ channel_id: 2 })
response.data // Response data will be of type Array.
-```
\ No newline at end of file
+```
diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/index.mdx b/apps/reference/_supabase_js_versioned_docs/version-v1/index.mdx
index b775dbbf9dc..8f37f5853e8 100644
--- a/apps/reference/_supabase_js_versioned_docs/version-v1/index.mdx
+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/index.mdx
@@ -1,12 +1,11 @@
---
id: index
-title: "Supabase Client"
+title: 'Supabase Client'
slug: supabase-client
custom_edit_url: ../../spec/supabase_js_v1.yml
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
-
-Supabase JavaScript.
\ No newline at end of file
+Supabase JavaScript.
diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/initializing.mdx b/apps/reference/_supabase_js_versioned_docs/version-v1/initializing.mdx
index 705503497f6..711f03f2aed 100644
--- a/apps/reference/_supabase_js_versioned_docs/version-v1/initializing.mdx
+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/initializing.mdx
@@ -1,24 +1,20 @@
---
id: initializing
-title: "Initializing"
+title: 'Initializing'
slug: initializing
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
You can initialize a new Supabase client using the `createClient()` method.
The Supabase client is your entrypoint to the rest of the Supabase functionality
and is the easiest way to interact with everything we offer within the Supabase ecosystem.
-
-
-
## Parameters
-
-
-
-
-
-
-
-
-
-
-
-
-
-
## Examples
### createClient()
-
-
```js
import { createClient } from '@supabase/supabase-js'
// Create a single supabase client for interacting with your database
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
+const supabase = createClient(
+ 'https://xyzcompany.supabase.co',
+ 'public-anon-key'
+)
```
### With additional parameters
-
-
```js
import { createClient } from '@supabase/supabase-js'
@@ -123,22 +103,28 @@ const options = {
headers: { 'x-my-custom-header': 'my-app-name' },
autoRefreshToken: true,
persistSession: true,
- detectSessionInUrl: true
+ detectSessionInUrl: true,
}
-const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key", options)
+const supabase = createClient(
+ 'https://xyzcompany.supabase.co',
+ 'public-anon-key',
+ options
+)
```
### API schemas
-
-
```js
import { createClient } from '@supabase/supabase-js'
// Provide a custom schema. Defaults to "public".
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
- schema: 'other_schema'
-})
+const supabase = createClient(
+ 'https://xyzcompany.supabase.co',
+ 'public-anon-key',
+ {
+ schema: 'other_schema',
+ }
+)
```
By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.
@@ -148,16 +134,18 @@ Note: each client connection can only access a single schema, so the code above
### Custom `fetch` implementation
-
-
```js
import { createClient } from '@supabase/supabase-js'
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
- fetch: fetch.bind(globalThis)
-})
+const supabase = createClient(
+ 'https://xyzcompany.supabase.co',
+ 'public-anon-key',
+ {
+ fetch: fetch.bind(globalThis),
+ }
+)
```
`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,
but an alternative `fetch` implementation can be provided as an option.
-This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).
\ No newline at end of file
+This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).
diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx b/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
index 5e21a5ba8f4..18d83d1fe6f 100644
--- a/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
@@ -1,12 +1,12 @@
---
id: installing
-title: "Installing"
+title: 'Installing'
slug: installing
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
All JavaScript libraries are built directly by the Supabase team.
@@ -15,11 +15,13 @@ Other languages are built by the community and supported by Supabase.
## JavaScript
Via NPM
+
```bash
npm install @supabase/supabase-js
```
Via Yarn
+
```bash
yarn add @supabase/supabase-js
```
@@ -27,8 +29,9 @@ yarn add @supabase/supabase-js
Find the source code on [GitHub](https://github.com/supabase/supabase-js).
Or via CDN
+
```js
//or
-```
\ No newline at end of file
+```
diff --git a/apps/reference/docs/about.mdx b/apps/reference/docs/about.mdx
index 07e696f4a9e..41cf64120b3 100755
--- a/apps/reference/docs/about.mdx
+++ b/apps/reference/docs/about.mdx
@@ -79,7 +79,7 @@ You can use it completely, or just the features you need.
description={'User management with Row Level Security.'}
style={{ height: '100%' }}
/>
-
+
{/* Auto-generated APIs */}
{frameworks.map((x) => (
-
{/* Next.js */}
@@ -38,7 +40,9 @@ A collection of framework-specific Auth utilities for working with Supabase.
class="card"
to={useBaseUrl('/guides/auth/auth-helpers/sveltekit')}
title={'SvelteKit'}
- description={'Helpers for authenticating users in SvelteKit applications.'}
+ description={
+ 'Helpers for authenticating users in SvelteKit applications.'
+ }
style={{ height: '100%' }}
/>
diff --git a/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx b/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx
index 193a970ebe9..724088ac743 100644
--- a/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx
+++ b/apps/reference/docs/guides/auth/auth-helpers/nextjs.mdx
@@ -2,7 +2,7 @@
id: nextjs
title: Supabase Auth with Next.js
description: Authentication helpers for Next.js API routes, middleware, and SSR.
-sidebar_label: "Next.js"
+sidebar_label: 'Next.js'
---
This submodule provides convenience helpers for implementing user authentication in Next.js applications.
diff --git a/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx b/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
index 4d7d1f3d317..67b655863dc 100644
--- a/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
+++ b/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
@@ -56,24 +56,28 @@ PUBLIC_SUPABASE_ANON_KEY=your-anon-key
Start off by creating a `db.ts` file inside of the `src/lib` directory and instantiate the `supabaseClient`.
```ts title="src/lib/db.ts"
-import { createClient } from '@supabase/supabase-js';
-import { setupSupabaseHelpers } from '@supabase/auth-helpers-sveltekit';
-import { dev } from '$app/environment';
-import { env } from '$env/dynamic/public';
+import { createClient } from '@supabase/supabase-js'
+import { setupSupabaseHelpers } from '@supabase/auth-helpers-sveltekit'
+import { dev } from '$app/environment'
+import { env } from '$env/dynamic/public'
// or use the static env
// import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public';
-export const supabaseClient = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY, {
- persistSession: false,
- autoRefreshToken: false
-});
+export const supabaseClient = createClient(
+ env.PUBLIC_SUPABASE_URL,
+ env.PUBLIC_SUPABASE_ANON_KEY,
+ {
+ persistSession: false,
+ autoRefreshToken: false,
+ }
+)
setupSupabaseHelpers({
- supabaseClient,
- cookieOptions: {
- secure: !dev
- }
-});
+ supabaseClient,
+ cookieOptions: {
+ secure: !dev,
+ },
+})
```
### Initialize the client
@@ -83,16 +87,16 @@ Edit your `+layout.svelte` file and set up the client-side.
```html title="src/routes/+layout.svelte"
@@ -104,16 +108,16 @@ The `hooks.ts` file is where the heavy lifting of this library happens:
```ts title="src/hooks.server.ts"
// make sure the supabase instance is initialized on the server
-import '$lib/db';
-import { dev } from '$app/environment';
-import { auth } from '@supabase/auth-helpers-sveltekit/server';
+import '$lib/db'
+import { dev } from '$app/environment'
+import { auth } from '@supabase/auth-helpers-sveltekit/server'
-export const handle = auth();
+export const handle = auth()
// use the sequence helper if you have additional Handle methods
-import { sequence } from '@sveltejs/kit/hooks';
+import { sequence } from '@sveltejs/kit/hooks'
-export const handle = sequence(auth(), yourHandler);
+export const handle = sequence(auth(), yourHandler)
```
There are three handle methods available:
@@ -130,13 +134,13 @@ There are three handle methods available:
In order to make the session available to the UI (e.g., pages and layouts), pass the session in the root layout load function:
```ts title="src/routes/+layout.server.ts"
-import type { LayoutServerLoad } from './$types';
+import type { LayoutServerLoad } from './$types'
export const load: LayoutServerLoad = async ({ locals }) => {
return {
- session: locals.session
- };
-};
+ session: locals.session,
+ }
+}
```
### Typings
@@ -151,10 +155,10 @@ In order to get the most out of TypeScript and IntelliSense, import the types in
// and what to do when importing types
declare namespace App {
interface Locals {
- session: import('@supabase/auth-helpers-sveltekit').SupabaseSession;
+ session: import('@supabase/auth-helpers-sveltekit').SupabaseSession
}
interface PageData {
- session: import('@supabase/auth-helpers-sveltekit').SupabaseSession;
+ session: import('@supabase/auth-helpers-sveltekit').SupabaseSession
}
// interface Error {}
// interface Platform {}
@@ -168,22 +172,23 @@ This library has provided a method to delete the session cookie.
Create a server only page with an action to delete the cookie
```ts title="src/routes/logout/+page.server.ts"
-import { deleteSession } from '@supabase/auth-helpers-sveltekit/server';
-import { redirect } from '@sveltejs/kit';
-import type { Actions } from './$types';
+import { deleteSession } from '@supabase/auth-helpers-sveltekit/server'
+import { redirect } from '@sveltejs/kit'
+import type { Actions } from './$types'
export const actions: Actions = {
- async default({ cookies }) {
- deleteSession(cookies);
- throw redirect(303, '/');
- }
-};
+ async default({ cookies }) {
+ deleteSession(cookies)
+ throw redirect(303, '/')
+ },
+}
```
+
Then make a **POST** request with a form to the server only page above.
```html