diff --git a/apps/reference/docs/guides/storage.mdx b/apps/reference/docs/guides/storage.mdx
index 70a735d13f2..0acaee503e7 100644
--- a/apps/reference/docs/guides/storage.mdx
+++ b/apps/reference/docs/guides/storage.mdx
@@ -31,7 +31,7 @@ keep all public files in a "public" bucket, and other files that require logged-
## Getting started
This is a quick guide that shows the basic functionality of Supabase Storage. Find a full
-[example application in GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management),
+[example application in GitHub](https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management/nextjs-ts-user-management),
which you can deploy yourself.
**Note before begin** : File, Folder, and Bucket names **must follow** [AWS Safe Characters naming guideline](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html) and avoid use of any other characters
diff --git a/apps/reference/docusaurus.config.js b/apps/reference/docusaurus.config.js
index 1ac01fdb972..b052ff8dfd0 100644
--- a/apps/reference/docusaurus.config.js
+++ b/apps/reference/docusaurus.config.js
@@ -16,7 +16,7 @@ const config = {
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: '/favicon.ico',
- themes: ['docusaurus-theme-search-typesense'],
+ // themes: ['docusaurus-theme-search-typesense'],
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
@@ -256,26 +256,26 @@ const config = {
darkTheme: darkCodeTheme,
},
- typesense: {
- typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
+ // typesense: {
+ // typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
- typesenseServerConfig: {
- nodes: [
- {
- host: 'doc-search.supabase.com',
- port: 443,
- protocol: 'https',
- },
- ],
- apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',
- },
+ // typesenseServerConfig: {
+ // nodes: [
+ // {
+ // host: 'doc-search.supabase.com',
+ // port: 443,
+ // protocol: 'https',
+ // },
+ // ],
+ // apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',
+ // },
- // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters
- typesenseSearchParameters: {},
+ // // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters
+ // typesenseSearchParameters: {},
- // Optional
- contextualSearch: true,
- },
+ // // Optional
+ // contextualSearch: true,
+ // },
}),
}
From c5673dc4d939623a4caf9106ec7927edf0b8b46c Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Tue, 16 Aug 2022 13:33:01 +0200
Subject: [PATCH 09/14] adds redirects
---
.../generated/auth-api-createuser.mdx | 283 ---------------
.../generated/auth-api-deleteuser.mdx | 60 ----
.../generated/auth-api-generatelink.mdx | 162 ---------
.../generated/auth-api-getuser.mdx | 59 ----
.../generated/auth-api-getuserbyid.mdx | 57 ---
.../generated/auth-api-inviteuserbyemail.mdx | 117 -------
.../generated/auth-api-listusers.mdx | 30 --
.../auth-api-resetpasswordforemail.mdx | 136 --------
.../generated/auth-api-updateuserbyid.mdx | 326 ------------------
.../_supabase_js/generated/auth-update.mdx | 178 ----------
apps/reference/nav/supabase_js_sidebars.js | 21 +-
apps/www/next.config.js | 50 +++
12 files changed, 60 insertions(+), 1419 deletions(-)
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-createuser.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-generatelink.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-getuser.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-listusers.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx
delete mode 100644 apps/reference/_supabase_js/generated/auth-update.mdx
diff --git a/apps/reference/_supabase_js/generated/auth-api-createuser.mdx b/apps/reference/_supabase_js/generated/auth-api-createuser.mdx
deleted file mode 100644
index 46c9ef301d4..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-createuser.mdx
+++ /dev/null
@@ -1,283 +0,0 @@
----
-id: auth-api-createuser
-title: 'createUser()'
-slug: /auth-api-createuser
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Creates a new user.
-This function should only be called on a server. Never expose your `service_role` key in the browser.
-
-```js
-const { data: user, error } = await supabase.auth.api.createUser({
- email: 'user@email.com',
- password: 'password',
- user_metadata: { name: 'Yoda' },
-})
-```
-
-## Parameters
-
-
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should be called on a server. Never expose your `service_role` key in the browser.
-- If you do not provide the `email_confirm` and `phone_confirm` options to this function, both will default to false.
-
-## Examples
-
-### Create a new user.
-
-```js
-const { data: user, error } = await supabase.auth.api.createUser({
- email: 'user@email.com',
- password: 'password',
- user_metadata: { name: 'Yoda' },
-})
-```
-
-### Auto-confirm email.
-
-```js
-const { data: user, error } = await supabase.auth.api.createUser({
- email: 'user@email.com',
- email_confirm: true,
-})
-```
-
-### Auto-confirm phone.
-
-```js
-const { data: user, error } = await supabase.auth.api.createUser({
- phone: '1234567890',
- phone_confirm: true,
-})
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx b/apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx
deleted file mode 100644
index d7e52882ef7..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-id: auth-api-deleteuser
-title: 'deleteUser()'
-slug: /auth-api-deleteuser
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Delete a user. Requires a `service_role` key.
-
-```js
-const { data: user, error } = await supabase.auth.api.deleteUser(
- '715ed5db-f090-4b8c-a067-640ecee36aa0'
-)
-```
-
-## Parameters
-
-
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should be called on a server. Never expose your `service_role` key in the browser.
-
-## Examples
-
-### Remove a user completely.
-
-```js
-const { data: user, error } = await supabase.auth.api.deleteUser(
- '715ed5db-f090-4b8c-a067-640ecee36aa0'
-)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-generatelink.mdx b/apps/reference/_supabase_js/generated/auth-api-generatelink.mdx
deleted file mode 100644
index ddff873d518..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-generatelink.mdx
+++ /dev/null
@@ -1,162 +0,0 @@
----
-id: auth-api-generatelink
-title: 'generateLink()'
-slug: /auth-api-generatelink
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Generates links to be sent via email or other.
-
-## Parameters
-
-
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should only be called on a server. Never expose your `service_role` key in the browser.
-
-## Examples
-
-### Generate invite link.
-
-```js
-const { data: user, error } = await supabase.auth.api.generateLink(
- 'invite',
- 'email@example.com'
-)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-getuser.mdx b/apps/reference/_supabase_js/generated/auth-api-getuser.mdx
deleted file mode 100644
index 7c958e35749..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-getuser.mdx
+++ /dev/null
@@ -1,59 +0,0 @@
----
-id: auth-api-getuser
-title: 'getUser()'
-slug: /auth-api-getuser
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Gets the current user details.
-
-This method is called by the GoTrueClient `update` where
-the jwt is set to this.currentSession.access_token
-and therefore, acts like getting the currently authenticated user
-
-```js
-const { user, error } = await supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
-```
-
-## Parameters
-
-
-
-## Notes
-
-- Fetches the user object from the database instead of local storage.
-- Note that user() fetches the user object from local storage which might not be the most updated.
-- Requires the user's access_token.
-
-## Examples
-
-### Fetch the user object using the access_token jwt.
-
-```js
-const { user, error } = await supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx b/apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx
deleted file mode 100644
index 03422876696..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx
+++ /dev/null
@@ -1,57 +0,0 @@
----
-id: auth-api-getuserbyid
-title: 'getUserById()'
-slug: /auth-api-getuserbyid
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Get user by id.
-
-```js
-const { user, error } = await supabase.auth.api.getUserById(1)
-```
-
-## Parameters
-
-
-
-## Notes
-
-- Fetches the user object from the database instead of local storage.
-- Note that user() fetches the user object from local storage which might not be the most updated.
-- Requires the user's access_token.
-
-## Examples
-
-### Fetch the user object using the access_token jwt.
-
-```js
-const { user, error } = await supabase.auth.api.getUserById(1)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx b/apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx
deleted file mode 100644
index 0cd2d0c6951..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx
+++ /dev/null
@@ -1,117 +0,0 @@
----
-id: auth-api-inviteuserbyemail
-title: 'inviteUserByEmail()'
-slug: /auth-api-inviteuserbyemail
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Sends an invite link to an email address.
-
-## Parameters
-
-
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should only be called on a server. Never expose your `service_role` key in the browser.
-
-## Examples
-
-### Basic example.
-
-```js
-const { data: user, error } = await supabase.auth.api.inviteUserByEmail(
- 'email@example.com'
-)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-listusers.mdx b/apps/reference/_supabase_js/generated/auth-api-listusers.mdx
deleted file mode 100644
index 8cb73a91217..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-listusers.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
----
-id: auth-api-listusers
-title: 'listUsers()'
-slug: /auth-api-listusers
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Get a list of users.
-
-This function should only be called on a server. Never expose your `service_role` key in the browser.
-
-```js
-const { data: user, error } = await supabase.auth.api.listUsers()
-```
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should be called on a server. Never expose your `service_role` key in the browser.
-
-## Examples
-
-### Get a full list of users.
-
-```js
-const { data: user, error } = await supabase.auth.api.listUsers()
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx b/apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx
deleted file mode 100644
index 79be4e6db18..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx
+++ /dev/null
@@ -1,136 +0,0 @@
----
-id: auth-api-resetpasswordforemail
-title: 'resetPasswordForEmail()'
-slug: /auth-api-resetpasswordforemail
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Sends a reset request to an email address.
-
-```js
-const { data, error } = await supabase.auth.api.resetPasswordForEmail(
- 'user@email.com'
-)
-```
-
-## Parameters
-
-
-
-## Notes
-
-Sends a reset request to an email address.
-
-When the user clicks the reset link in the email they will be forwarded to:
-
-`
#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
-
-Your app must detect `type=recovery` in the fragment and display a password reset form to the user.
-
-You should then use the access_token in the url and new password to update the user as follows:
-
-```js
-const { error, data } = await supabase.auth.api.updateUser(access_token, {
- password: new_password,
-})
-```
-
-## Examples
-
-### Reset password
-
-```js
-const { data, error } = await supabase.auth.api.resetPasswordForEmail(
- 'user@email.com'
-)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx b/apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx
deleted file mode 100644
index 2e55fc9ad9d..00000000000
--- a/apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx
+++ /dev/null
@@ -1,326 +0,0 @@
----
-id: auth-api-updateuserbyid
-title: 'updateUserById()'
-slug: /auth-api-updateuserbyid
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Updates the user data.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { email: 'new@email.com' }
-)
-```
-
-## Parameters
-
-
-
-## Notes
-
-- Requires a `service_role` key.
-- This function should only be called on a server. Never expose your `service_role` key in the browser.
-
-## Examples
-
-### Updates a user's email.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { email: 'new@email.com' }
-)
-```
-
-### Updates a user's password.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { password: 'new_password' }
-)
-```
-
-### Updates a user's metadata.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { user_metadata: { hello: 'world' } }
-)
-```
-
-### Updates a user's app_metadata.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { app_metadata: { plan: 'trial' } }
-)
-```
-
-### Confirms a user's email address.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { email_confirm: true }
-)
-```
-
-### Confirms a user's phone number.
-
-```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
- '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { phone_confirm: true }
-)
-```
diff --git a/apps/reference/_supabase_js/generated/auth-update.mdx b/apps/reference/_supabase_js/generated/auth-update.mdx
deleted file mode 100644
index 7010074dcbc..00000000000
--- a/apps/reference/_supabase_js/generated/auth-update.mdx
+++ /dev/null
@@ -1,178 +0,0 @@
----
-id: auth-update
-title: 'update()'
-slug: /auth-update
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-Updates user data, if there is a logged in user.
-
-```js
-const { user, error } = await supabase.auth.update({ email: 'new@email.com' })
-```
-
-## Parameters
-
-
-
-## Notes
-
-User email: Email updates will send an email to both the user's current and new email with a confirmation link by default.
-To toggle this behavior off and only send a single confirmation link to the new email, toggle "Double confirm email changes" under "Authentication" -> "Settings" off.
-
-User metadata: It's generally better to store user data in a table inside your public schema (i.e. `public.users`).
-Use the `update()` method if you have data which rarely changes or is specific only to the logged in user.
-
-## Examples
-
-### Update email for authenticated user.
-
-Sends a "Confirm Email Change" email to the new email address.
-
-```js
-const { user, error } = await supabase.auth.update({ email: 'new@email.com' })
-```
-
-### Update password for authenticated user.
-
-```js
-const { user, error } = await supabase.auth.update({ password: 'new password' })
-```
-
-### Update a user's metadata.
-
-```js
-const { user, error } = await supabase.auth.update({
- data: { hello: 'world' },
-})
-```
diff --git a/apps/reference/nav/supabase_js_sidebars.js b/apps/reference/nav/supabase_js_sidebars.js
index 93e5c785c99..cd44846aff8 100644
--- a/apps/reference/nav/supabase_js_sidebars.js
+++ b/apps/reference/nav/supabase_js_sidebars.js
@@ -41,11 +41,11 @@ const sidebars = {
'generated/auth-signout',
'generated/auth-getsession',
'generated/auth-getuser',
- 'generated/auth-update',
+ 'generated/auth-updateuser',
'generated/auth-setsession',
'generated/auth-onauthstatechange',
- 'generated/auth-api-getuser',
- 'generated/auth-api-resetpasswordforemail',
+ 'generated/auth-getuser',
+ 'generated/auth-resetpasswordforemail',
],
collapsed: true,
},
@@ -53,14 +53,13 @@ const sidebars = {
type: 'category',
label: 'Auth (Server Only)',
items: [
- 'generated/auth-api-listusers',
- 'generated/auth-api-createuser',
- 'generated/auth-api-deleteuser',
- 'generated/auth-api-generatelink',
- 'generated/auth-api-inviteuserbyemail',
- // 'generated/auth-api-sendmobileotp',
- 'generated/auth-api-getuserbyid',
- 'generated/auth-api-updateuserbyid',
+ 'generated/auth-admin-listusers',
+ 'generated/auth-admin-createuser',
+ 'generated/auth-admin-deleteuser',
+ 'generated/auth-admin-generatelink',
+ 'generated/auth-admin-inviteuserbyemail',
+ 'generated/auth-admin-getuserbyid',
+ 'generated/auth-admin-updateuserbyid',
],
collapsed: true,
},
diff --git a/apps/www/next.config.js b/apps/www/next.config.js
index acba685a82f..5933cf6be18 100644
--- a/apps/www/next.config.js
+++ b/apps/www/next.config.js
@@ -1413,6 +1413,56 @@ module.exports = withMDX({
source: '/docs/guides/local-development',
destination: '/docs/guides/cli/local-development',
},
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-update',
+ destination: '/docs/reference/javascript/auth-updateuser',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-getuser',
+ destination: '/docs/reference/javascript/auth-getuser',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-resetpasswordforemail',
+ destination: '/docs/reference/javascript/auth-resetpasswordforemail',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-listusers',
+ destination: '/docs/reference/javascript/auth-admin-listusers',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-createuser',
+ destination: '/docs/reference/javascript/auth-admin-createuser',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-deleteuser',
+ destination: '/docs/reference/javascript/auth-admin-deleteuser',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-generatelink',
+ destination: '/docs/reference/javascript/auth-admin-generatelink',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-inviteuserbyemail',
+ destination: '/docs/reference/javascript/auth-admin-inviteuserbyemail',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-getuserbyid',
+ destination: '/docs/reference/javascript/auth-admin-getuserbyid',
+ },
+ {
+ permanent: true,
+ source: '/docs/reference/javascript/auth-api-updateuserbyid',
+ destination: '/docs/reference/javascript/auth-admin-updateuserbyid',
+ },
]
},
})
From 531fd15f4c36aa965b717ba55c383c54e5d2d0b5 Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Tue, 16 Aug 2022 13:33:26 +0200
Subject: [PATCH 10/14] Adds typesense back
---
apps/reference/docusaurus.config.js | 36 ++++++++++++++---------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/apps/reference/docusaurus.config.js b/apps/reference/docusaurus.config.js
index b052ff8dfd0..1ac01fdb972 100644
--- a/apps/reference/docusaurus.config.js
+++ b/apps/reference/docusaurus.config.js
@@ -16,7 +16,7 @@ const config = {
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: '/favicon.ico',
- // themes: ['docusaurus-theme-search-typesense'],
+ themes: ['docusaurus-theme-search-typesense'],
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
@@ -256,26 +256,26 @@ const config = {
darkTheme: darkCodeTheme,
},
- // typesense: {
- // typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
+ typesense: {
+ typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
- // typesenseServerConfig: {
- // nodes: [
- // {
- // host: 'doc-search.supabase.com',
- // port: 443,
- // protocol: 'https',
- // },
- // ],
- // apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',
- // },
+ typesenseServerConfig: {
+ nodes: [
+ {
+ host: 'doc-search.supabase.com',
+ port: 443,
+ protocol: 'https',
+ },
+ ],
+ apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',
+ },
- // // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters
- // typesenseSearchParameters: {},
+ // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters
+ typesenseSearchParameters: {},
- // // Optional
- // contextualSearch: true,
- // },
+ // Optional
+ contextualSearch: true,
+ },
}),
}
From 37601f7c03d815462a56ec0f5987b519c3096195 Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Tue, 16 Aug 2022 13:45:06 +0200
Subject: [PATCH 11/14] revert redirects
---
apps/www/next.config.js | 101 ++++++++++++++++++++--------------------
1 file changed, 51 insertions(+), 50 deletions(-)
diff --git a/apps/www/next.config.js b/apps/www/next.config.js
index 5933cf6be18..36703af7ae8 100644
--- a/apps/www/next.config.js
+++ b/apps/www/next.config.js
@@ -1413,56 +1413,57 @@ module.exports = withMDX({
source: '/docs/guides/local-development',
destination: '/docs/guides/cli/local-development',
},
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-update',
- destination: '/docs/reference/javascript/auth-updateuser',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-getuser',
- destination: '/docs/reference/javascript/auth-getuser',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-resetpasswordforemail',
- destination: '/docs/reference/javascript/auth-resetpasswordforemail',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-listusers',
- destination: '/docs/reference/javascript/auth-admin-listusers',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-createuser',
- destination: '/docs/reference/javascript/auth-admin-createuser',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-deleteuser',
- destination: '/docs/reference/javascript/auth-admin-deleteuser',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-generatelink',
- destination: '/docs/reference/javascript/auth-admin-generatelink',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-inviteuserbyemail',
- destination: '/docs/reference/javascript/auth-admin-inviteuserbyemail',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-getuserbyid',
- destination: '/docs/reference/javascript/auth-admin-getuserbyid',
- },
- {
- permanent: true,
- source: '/docs/reference/javascript/auth-api-updateuserbyid',
- destination: '/docs/reference/javascript/auth-admin-updateuserbyid',
- },
+ // V2 redirects
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-update',
+ // destination: '/docs/reference/javascript/auth-updateuser',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-getuser',
+ // destination: '/docs/reference/javascript/auth-getuser',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-resetpasswordforemail',
+ // destination: '/docs/reference/javascript/auth-resetpasswordforemail',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-listusers',
+ // destination: '/docs/reference/javascript/auth-admin-listusers',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-createuser',
+ // destination: '/docs/reference/javascript/auth-admin-createuser',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-deleteuser',
+ // destination: '/docs/reference/javascript/auth-admin-deleteuser',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-generatelink',
+ // destination: '/docs/reference/javascript/auth-admin-generatelink',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-inviteuserbyemail',
+ // destination: '/docs/reference/javascript/auth-admin-inviteuserbyemail',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-getuserbyid',
+ // destination: '/docs/reference/javascript/auth-admin-getuserbyid',
+ // },
+ // {
+ // permanent: true,
+ // source: '/docs/reference/javascript/auth-api-updateuserbyid',
+ // destination: '/docs/reference/javascript/auth-admin-updateuserbyid',
+ // },
]
},
})
From 7208fbb22066141778933f0d652f3868b7ab8944 Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Tue, 16 Aug 2022 14:16:10 +0200
Subject: [PATCH 12/14] Very rough release notes
---
.../reference/_supabase_js/migration-guide.md | 7 -
apps/reference/_supabase_js/release-notes.md | 146 +++++++++++++++++-
apps/reference/nav/supabase_js_sidebars.js | 1 -
3 files changed, 143 insertions(+), 11 deletions(-)
delete mode 100644 apps/reference/_supabase_js/migration-guide.md
diff --git a/apps/reference/_supabase_js/migration-guide.md b/apps/reference/_supabase_js/migration-guide.md
deleted file mode 100644
index e483c0f7e02..00000000000
--- a/apps/reference/_supabase_js/migration-guide.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-id: migration-guide
----
-
-# Migration Guide
-
-Migrating from v1 to v2.
diff --git a/apps/reference/_supabase_js/release-notes.md b/apps/reference/_supabase_js/release-notes.md
index c566dc1f89f..da30876c645 100644
--- a/apps/reference/_supabase_js/release-notes.md
+++ b/apps/reference/_supabase_js/release-notes.md
@@ -4,8 +4,148 @@ id: release-notes
# Release Notes
-Supabase.js v2 release
+Supabase.js v2 release notes.
-## 2.0.0
+## 2.0.0 Release Candidate
-TBD
+Install the latest with `npm install @supabase/supabase-js@2.0.0-rc.1`.
+
+### Explicit constructor options
+
+All client specific options within the constructor are keyed to the library: [PR](https://github.com/supabase/supabase-js/pull/458):
+
+```jsx
+const supabase = createClient(apiURL, apiKey, {
+ // subclient specific options
+ // should map 1 - 1 with the constructor options of the underlying library
+ // any options here will override the common options later on in the client
+ db: {
+ schema: 'public',
+ },
+ auth: {
+ autoRefreshToken: true,
+ persistSession: true,
+ detectSessionInUrl: true,
+ },
+ // realtime already does this :heart-eyes:
+ realtime: {
+ channels,
+ endpoint,
+ },
+ // common across all libraries
+ global: {
+ fetch: customFetch,
+ headers: DEFAULT_HEADERS
+ }
+});
+```
+
+### Data operations return minimal
+
+`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).
+
+Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end, e.g.:
+
+```sql
+const { data, error } = await supabase
+ .from('my_table')
+ .delete()
+ .eq('id', 1)
+ .select()
+```
+### New ordering defaults
+
+`.order()`: `nullsFirst` defaults to Postgres’s default (https://github.com/supabase/postgrest-js/pull/283).
+
+Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last. This is bad for performance if e.g. the column uses an index with `NULLS FIRST` (which is the default direction for indexes).
+
+### Cookies and localstorage namespace
+
+Storage key name in the Auth library has changed to include project reference which means that existing website that had their JWT expiry set to a longer time could find their user’s logged out with this upgrade.
+
+```jsx
+const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`
+```
+
+### New Auth Types
+
+Typescript typings have been reworked. `Session` interface now guarantees that it will always have an `access_token`, `refresh_token` and `user`
+
+```jsx
+interface Session {
+ provider_token?: string | null
+ access_token: string
+ expires_in?: number
+ expires_at?: number
+ refresh_token: string
+ token_type: string
+ user: User
+}
+```
+### Deprecated setAuth()
+
+Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead, pass the custom header into the `createClient()` method provided: ([PR](https://github.com/supabase/gotrue-js/pull/340))
+
+```jsx
+// example of using supabase client on the server-side in a request handler
+app.get('/example', (req, res) => {
+ const supabase = createClient(process.env.SUPABASE_URL, req.cookies['sb-access-token'])
+ ...
+})
+```
+
+### Other changes
+
+- `supabase-js`
+ - `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).
+- `postgrest-js`
+ - TypeScript typings have been reworked [PR](https://github.com/supabase/postgrest-js/pull/279)
+ - Use `undefined` instead of `null` for function params, types, etc. (https://github.com/supabase/postgrest-js/pull/278)
+ - Some features are now obsolete: (https://github.com/supabase/postgrest-js/pull/275)
+ - filter shorthands (e.g. `cs` vs. `contains`)
+ - `body` in response (vs. `data`)
+ - `upsert`ing through the `.insert()` method
+ - `auth` method on `PostgrestClient`
+ - client-level `throwOnError`
+- `gotrue-js`
+ - `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))
+ - `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
+ - Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
+ - Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))
+ - No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))
+ - `AuthSessionMissingError`
+ - Indicates that a session is expected but missing
+ - `AuthNoCookieError`
+ - Indicates that a cookie is expected but missing
+ - `AuthInvalidCredentialsError`
+ - Indicates that the incorrect credentials were passed
+ - Renamed the `api` namespace to `admin` , the `admin` namespace will only contain methods that should only be used in a trusted server-side environment with the service role key
+ - Moved `resetPasswordForEmail` , `getUser` and `updateUser` to the `GoTrueClient` which means they will be accessible from the `supabase.auth` namespace in `supabase-js` instead of having to do `supabase.auth.api` to access them
+ - Removed `sendMobileOTP` , `sendMagicLinkEmail` in favor of `signInWithOtp`
+ - Removed `signInWithEmail`, `signInWithPhone` in favor of `signInWithPassword`
+ - Removed `signUpWithEmail` , `signUpWithPhone` in favor of `signUp`
+- `storage-js`
+ - Return types are more strict. Functions types used to indicate that the data returned could be null even if there was no error. We now make use of union types which only mark the data as null if there is an error and vice versa. ([PR](https://github.com/supabase/storage-js/pull/60))
+ - The `upload` and `update` function returns the path of the object uploaded as the `path` parameter. Previously the returned value had the bucket name prepended to the path which made it harder to pass the value on to other storage-js methods since all methods take the bucket name and path separately. We also chose to call the returned value `path` instead of `Key` ([PR](https://github.com/supabase/storage-js/pull/75))
+ - `getPublicURL` only returns the public URL inside the data object. This keeps it consistent with our other methods of returning only within the data object. No error is returned since this method cannot does not throw an error ([PR](https://github.com/supabase/storage-js/pull/93))
+ - signed urls are returned as `signedUrl` instead of `signedURL` in both `createSignedUrl` and `createSignedUrls` ([PR](https://github.com/supabase/storage-js/pull/94))
+ - Encodes URLs returned by `createSignedUrl`, `createSignedUrls` and `getPublicUrl` ([PR](https://github.com/supabase/storage-js/pull/86))
+ - `createsignedUrl` used to return a url directly and and within the data object. This was inconsistent. Now we always return values only inside the data object across all methods. ([PR](https://www.notion.so/LW5-supabase-js-v2-7b0bfcdf571d4f20b9b7a9308883f24b))
+ - `createBucket` returns a data object instead of the name of the bucket directly. ([PR](https://github.com/supabase/storage-js/pull/89))
+ - Fixed types for metadata ([PR](https://github.com/supabase/storage-js/pull/90))
+ - Better error types make it easier to track down what went wrong quicker.
+ - `SupabaseStorageClient` is no longer exported. Use `StorageClient` instead. ([PR](https://github.com/supabase/storage-js/pull/92)).
+- `realtime-js`
+ - `RealtimeSubscription` class no longer exists and replaced by `RealtimeChannel`.
+ - `RealtimeClient`'s `disconnect` method now returns type of `void` . It used to return type of `Promise<{ error: Error | null; data: boolean }`.
+ - Removed `removeAllSubscriptions` and `removeSubscription` methods from `SupabaseClient` class.
+ - Removed `SupabaseRealtimeClient` class.
+ - Removed `SupabaseQueryBuilder` class.
+ - Removed `SupabaseEventTypes` type.
+ - Thinking about renaming this to something like `RealtimePostgresChangeEvents` and moving it to `realtime-js` v2.
+ - Removed `.from(’table’).on(’INSERT’, () ⇒ {}).subscribe()` in favor of new Realtime client API.
+- `functions-js`
+ - supabase-js v1 only threw an error if the fetch call itself threw an error (network errors, etc) and not if the function returned HTTP errors like 400s or 500s. We have changed this behaviour to return an error if your function throws an error.
+ - We have introduced new error types to distinguish between different kinds of errors. A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function.
+ - The correct content-type headers are automatically attached when sending the request if you don’t pass in a `Content-Type` header and pass in an argument to your function. We automatically attach the content type for `Blob`, `ArrayBuffer`, `File`, `FormData` ,`String` . If it doesn’t match any of these we assume the payload is `json` , we serialise the payload as JSON and attach the content type as `application/json`.
+ - `responseType` does not need to be explicitly passed in. We parse the response based on the `Content-Type` response header sent by the function. We support parsing the responses as `text`, `json`, `blob`, `form-data` and are parsed as `text` by default.
\ No newline at end of file
diff --git a/apps/reference/nav/supabase_js_sidebars.js b/apps/reference/nav/supabase_js_sidebars.js
index cd44846aff8..14e4cbfcaad 100644
--- a/apps/reference/nav/supabase_js_sidebars.js
+++ b/apps/reference/nav/supabase_js_sidebars.js
@@ -26,7 +26,6 @@ const sidebars = {
'initializing',
'typescript-support',
'release-notes',
- 'migration-guide',
],
collapsed: false,
},
From 9d61b3f85a4158d1019cecc11812cf97b27f68e2 Mon Sep 17 00:00:00 2001
From: Copple <10214025+kiwicopple@users.noreply.github.com>
Date: Tue, 16 Aug 2022 14:34:50 +0200
Subject: [PATCH 13/14] more relase notes
---
apps/reference/_supabase_js/release-notes.md | 91 +++++++++++++++++---
1 file changed, 78 insertions(+), 13 deletions(-)
diff --git a/apps/reference/_supabase_js/release-notes.md b/apps/reference/_supabase_js/release-notes.md
index da30876c645..de947a1c740 100644
--- a/apps/reference/_supabase_js/release-notes.md
+++ b/apps/reference/_supabase_js/release-notes.md
@@ -33,13 +33,36 @@ const supabase = createClient(apiURL, apiKey, {
endpoint,
},
// common across all libraries
- global: {
- fetch: customFetch,
- headers: DEFAULT_HEADERS
- }
+ global: {
+ fetch: customFetch,
+ headers: DEFAULT_HEADERS
+ }
});
```
+### Typescript support
+
+
+The libraries now support typescript.
+
+```ts
+
+// v2 - definitions are injected in `createClient()`
+import type { Database } from "./DatabaseDefinitions";
+const supabase = createClient(SUPABASE_URL, ANON_KEY)
+const { data } = await supabase.from('messages').select().match({ id: 1 })
+
+// v1 -- previously definitions were injected in the `from()` method
+supabase.from('messages').select('*')
+```
+
+Types can be generated via the CLI:
+
+```bash
+supabase start
+supabase gen types typescript --local > DatabaseDefinitions.ts
+```
+
### Data operations return minimal
`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).
@@ -55,7 +78,7 @@ const { data, error } = await supabase
```
### New ordering defaults
-`.order()`: `nullsFirst` defaults to Postgres’s default (https://github.com/supabase/postgrest-js/pull/283).
+`.order()` now defaults to Postgres’s default: [PR](https://github.com/supabase/postgrest-js/pull/283).
Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last. This is bad for performance if e.g. the column uses an index with `NULLS FIRST` (which is the default direction for indexes).
@@ -82,19 +105,61 @@ interface Session {
user: User
}
```
+
+### New Auth methods
+
+We're removing the `signIn()` method in favor of more explicit function signatures:
+`signInWithPassword()`, `signInWithPasswordless()`, and `signInWithOtp()`.
+
+```ts
+// v2
+const { data } = await supabase.auth.signInWithPassword({
+ email: 'hello@example',
+ password: 'pass',
+})
+// v1
+const { data } = await supabase.auth.signIn({
+ email: 'hello@example',
+ password: 'pass',
+})
+```
+
+### New Realtime methods
+
+There is a new `channel()` method in the Realtime library, which will be used for our Multiplayer updates.
+
+```ts
+supabaseClient
+ .channel('any_string_you_want')
+ .on('presence', { event: 'track' }, (payload) => {
+ console.log(payload)
+ })
+ .subscribe()
+
+supabaseClient
+ .channel('any_string_you_want')
+ .on(
+ 'postgres_changes',
+ {
+ event: 'INSERT',
+ schema: 'public',
+ table: 'movies',
+ },
+ (payload) => {
+ console.log(payload)
+ }
+ )
+ .subscribe()
+```
+
+We will deprecate the `.from().on().subscribe()` method previosuly used for listening to postgres changes.
+
### Deprecated setAuth()
Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead, pass the custom header into the `createClient()` method provided: ([PR](https://github.com/supabase/gotrue-js/pull/340))
-```jsx
-// example of using supabase client on the server-side in a request handler
-app.get('/example', (req, res) => {
- const supabase = createClient(process.env.SUPABASE_URL, req.cookies['sb-access-token'])
- ...
-})
-```
-### Other changes
+### All changes
- `supabase-js`
- `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).
From dd76d1e9b167229d3bb8b7e8b891ed60288f9287 Mon Sep 17 00:00:00 2001
From: Inian
Date: Tue, 16 Aug 2022 21:38:21 +0800
Subject: [PATCH 14/14] run prettier
---
apps/reference/_supabase_js/release-notes.md | 76 ++++++++++----------
apps/reference/docs/guides/with-expo.mdx | 2 +-
2 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/apps/reference/_supabase_js/release-notes.md b/apps/reference/_supabase_js/release-notes.md
index de947a1c740..a0b48c82648 100644
--- a/apps/reference/_supabase_js/release-notes.md
+++ b/apps/reference/_supabase_js/release-notes.md
@@ -16,39 +16,37 @@ All client specific options within the constructor are keyed to the library: [PR
```jsx
const supabase = createClient(apiURL, apiKey, {
- // subclient specific options
- // should map 1 - 1 with the constructor options of the underlying library
- // any options here will override the common options later on in the client
- db: {
- schema: 'public',
- },
- auth: {
- autoRefreshToken: true,
- persistSession: true,
- detectSessionInUrl: true,
- },
- // realtime already does this :heart-eyes:
- realtime: {
- channels,
- endpoint,
- },
- // common across all libraries
- global: {
- fetch: customFetch,
- headers: DEFAULT_HEADERS
- }
-});
+ // subclient specific options
+ // should map 1 - 1 with the constructor options of the underlying library
+ // any options here will override the common options later on in the client
+ db: {
+ schema: 'public',
+ },
+ auth: {
+ autoRefreshToken: true,
+ persistSession: true,
+ detectSessionInUrl: true,
+ },
+ // realtime already does this :heart-eyes:
+ realtime: {
+ channels,
+ endpoint,
+ },
+ // common across all libraries
+ global: {
+ fetch: customFetch,
+ headers: DEFAULT_HEADERS,
+ },
+})
```
### Typescript support
-
The libraries now support typescript.
```ts
-
// v2 - definitions are injected in `createClient()`
-import type { Database } from "./DatabaseDefinitions";
+import type { Database } from './DatabaseDefinitions'
const supabase = createClient(SUPABASE_URL, ANON_KEY)
const { data } = await supabase.from('messages').select().match({ id: 1 })
@@ -76,6 +74,7 @@ const { data, error } = await supabase
.eq('id', 1)
.select()
```
+
### New ordering defaults
`.order()` now defaults to Postgres’s default: [PR](https://github.com/supabase/postgrest-js/pull/283).
@@ -87,13 +86,15 @@ Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last.
Storage key name in the Auth library has changed to include project reference which means that existing website that had their JWT expiry set to a longer time could find their user’s logged out with this upgrade.
```jsx
-const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`
+const defaultStorageKey = `sb-${
+ new URL(this.authUrl).hostname.split('.')[0]
+}-auth-token`
```
### New Auth Types
Typescript typings have been reworked. `Session` interface now guarantees that it will always have an `access_token`, `refresh_token` and `user`
-
+
```jsx
interface Session {
provider_token?: string | null
@@ -158,11 +159,10 @@ We will deprecate the `.from().on().subscribe()` method previosuly used for list
Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead, pass the custom header into the `createClient()` method provided: ([PR](https://github.com/supabase/gotrue-js/pull/340))
-
### All changes
- `supabase-js`
- - `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).
+ - `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).
- `postgrest-js`
- TypeScript typings have been reworked [PR](https://github.com/supabase/postgrest-js/pull/279)
- Use `undefined` instead of `null` for function params, types, etc. (https://github.com/supabase/postgrest-js/pull/278)
@@ -174,16 +174,16 @@ Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead,
- client-level `throwOnError`
- `gotrue-js`
- `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))
- - `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
+ - `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
- Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
- Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))
- No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))
- - `AuthSessionMissingError`
- - Indicates that a session is expected but missing
- - `AuthNoCookieError`
- - Indicates that a cookie is expected but missing
- - `AuthInvalidCredentialsError`
- - Indicates that the incorrect credentials were passed
+ - `AuthSessionMissingError`
+ - Indicates that a session is expected but missing
+ - `AuthNoCookieError`
+ - Indicates that a cookie is expected but missing
+ - `AuthInvalidCredentialsError`
+ - Indicates that the incorrect credentials were passed
- Renamed the `api` namespace to `admin` , the `admin` namespace will only contain methods that should only be used in a trusted server-side environment with the service role key
- Moved `resetPasswordForEmail` , `getUser` and `updateUser` to the `GoTrueClient` which means they will be accessible from the `supabase.auth` namespace in `supabase-js` instead of having to do `supabase.auth.api` to access them
- Removed `sendMobileOTP` , `sendMagicLinkEmail` in favor of `signInWithOtp`
@@ -193,7 +193,7 @@ Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead,
- Return types are more strict. Functions types used to indicate that the data returned could be null even if there was no error. We now make use of union types which only mark the data as null if there is an error and vice versa. ([PR](https://github.com/supabase/storage-js/pull/60))
- The `upload` and `update` function returns the path of the object uploaded as the `path` parameter. Previously the returned value had the bucket name prepended to the path which made it harder to pass the value on to other storage-js methods since all methods take the bucket name and path separately. We also chose to call the returned value `path` instead of `Key` ([PR](https://github.com/supabase/storage-js/pull/75))
- `getPublicURL` only returns the public URL inside the data object. This keeps it consistent with our other methods of returning only within the data object. No error is returned since this method cannot does not throw an error ([PR](https://github.com/supabase/storage-js/pull/93))
- - signed urls are returned as `signedUrl` instead of `signedURL` in both `createSignedUrl` and `createSignedUrls` ([PR](https://github.com/supabase/storage-js/pull/94))
+ - signed urls are returned as `signedUrl` instead of `signedURL` in both `createSignedUrl` and `createSignedUrls` ([PR](https://github.com/supabase/storage-js/pull/94))
- Encodes URLs returned by `createSignedUrl`, `createSignedUrls` and `getPublicUrl` ([PR](https://github.com/supabase/storage-js/pull/86))
- `createsignedUrl` used to return a url directly and and within the data object. This was inconsistent. Now we always return values only inside the data object across all methods. ([PR](https://www.notion.so/LW5-supabase-js-v2-7b0bfcdf571d4f20b9b7a9308883f24b))
- `createBucket` returns a data object instead of the name of the bucket directly. ([PR](https://github.com/supabase/storage-js/pull/89))
@@ -213,4 +213,4 @@ Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead,
- supabase-js v1 only threw an error if the fetch call itself threw an error (network errors, etc) and not if the function returned HTTP errors like 400s or 500s. We have changed this behaviour to return an error if your function throws an error.
- We have introduced new error types to distinguish between different kinds of errors. A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function.
- The correct content-type headers are automatically attached when sending the request if you don’t pass in a `Content-Type` header and pass in an argument to your function. We automatically attach the content type for `Blob`, `ArrayBuffer`, `File`, `FormData` ,`String` . If it doesn’t match any of these we assume the payload is `json` , we serialise the payload as JSON and attach the content type as `application/json`.
- - `responseType` does not need to be explicitly passed in. We parse the response based on the `Content-Type` response header sent by the function. We support parsing the responses as `text`, `json`, `blob`, `form-data` and are parsed as `text` by default.
\ No newline at end of file
+ - `responseType` does not need to be explicitly passed in. We parse the response based on the `Content-Type` response header sent by the function. We support parsing the responses as `text`, `json`, `blob`, `form-data` and are parsed as `text` by default.
diff --git a/apps/reference/docs/guides/with-expo.mdx b/apps/reference/docs/guides/with-expo.mdx
index cd2b5e19d81..830963dd484 100644
--- a/apps/reference/docs/guides/with-expo.mdx
+++ b/apps/reference/docs/guides/with-expo.mdx
@@ -423,7 +423,7 @@ import { View } from 'react-native'
import { Session } from '@supabase/supabase-js'
export default function App() {
- const [session, setSession] = useState(null);
+ const [session, setSession] = (useState < Session) | (null > null)
useEffect(() => {
setSession(supabase.auth.session())