diff --git a/apps/reference/_supabase_js/generated/auth-api-createuser.mdx b/apps/reference/_supabase_js/generated/auth-admin-createuser.mdx
similarity index 94%
rename from apps/reference/_supabase_js/generated/auth-api-createuser.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-createuser.mdx
index 46c9ef301d4..20d8633252b 100644
--- a/apps/reference/_supabase_js/generated/auth-api-createuser.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-createuser.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-createuser
+id: auth-admin-createuser
title: 'createUser()'
-slug: /auth-api-createuser
+slug: /auth-admin-createuser
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -12,7 +12,7 @@ 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({
+const { data, error } = await supabase.auth.admin.createUser({
email: 'user@email.com',
password: 'password',
user_metadata: { name: 'Yoda' },
@@ -257,7 +257,7 @@ this attribute is used instead of UserAttributes data.
### Create a new user.
```js
-const { data: user, error } = await supabase.auth.api.createUser({
+const { data, error } = await supabase.auth.admin.createUser({
email: 'user@email.com',
password: 'password',
user_metadata: { name: 'Yoda' },
@@ -267,7 +267,7 @@ const { data: user, error } = await supabase.auth.api.createUser({
### Auto-confirm email.
```js
-const { data: user, error } = await supabase.auth.api.createUser({
+const { data, error } = await supabase.auth.admin.createUser({
email: 'user@email.com',
email_confirm: true,
})
@@ -276,7 +276,7 @@ const { data: user, error } = await supabase.auth.api.createUser({
### Auto-confirm phone.
```js
-const { data: user, error } = await supabase.auth.api.createUser({
+const { data, error } = await supabase.auth.admin.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-admin-deleteuser.mdx
similarity index 86%
rename from apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-deleteuser.mdx
index d7e52882ef7..637e8524f4e 100644
--- a/apps/reference/_supabase_js/generated/auth-api-deleteuser.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-deleteuser.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-deleteuser
+id: auth-admin-deleteuser
title: 'deleteUser()'
-slug: /auth-api-deleteuser
+slug: /auth-admin-deleteuser
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Delete a user. Requires a `service_role` key.
```js
-const { data: user, error } = await supabase.auth.api.deleteUser(
+const { data, error } = await supabase.auth.admin.deleteUser(
'715ed5db-f090-4b8c-a067-640ecee36aa0'
)
```
@@ -54,7 +54,7 @@ This function should only be called on a server. Never expose your `service_role
### Remove a user completely.
```js
-const { data: user, error } = await supabase.auth.api.deleteUser(
+const { data, error } = await supabase.auth.admin.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-admin-generatelink.mdx
similarity index 88%
rename from apps/reference/_supabase_js/generated/auth-api-generatelink.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-generatelink.mdx
index ddff873d518..c39e78a2a36 100644
--- a/apps/reference/_supabase_js/generated/auth-api-generatelink.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-generatelink.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-generatelink
+id: auth-admin-generatelink
title: 'generateLink()'
-slug: /auth-api-generatelink
+slug: /auth-admin-generatelink
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -10,6 +10,16 @@ import TabItem from '@theme/TabItem'
Generates links to be sent via email or other.
+```js
+const { data, error } = await supabase.auth.admin.generateLink(
+ 'email@example.com'
+ 'signup',
+ {
+ 'password': 'secret'
+ }
+)
+```
+
## Parameters
@@ -152,11 +162,23 @@ The redirect url which should be appended to the generated link
## Examples
-### Generate invite link.
+### Generate a signup link.
```js
-const { data: user, error } = await supabase.auth.api.generateLink(
- 'invite',
+const { data, error } = await supabase.auth.admin.generateLink(
'email@example.com'
+ 'signup',
+ {
+ 'password': 'secret'
+ }
+)
+```
+
+### Generate an invite link.
+
+```js
+const { data, error } = await supabase.auth.admin.generateLink(
+ 'email@example.com'
+ 'invite',
)
```
diff --git a/apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx b/apps/reference/_supabase_js/generated/auth-admin-getuserbyid.mdx
similarity index 85%
rename from apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-getuserbyid.mdx
index 03422876696..679a72505cf 100644
--- a/apps/reference/_supabase_js/generated/auth-api-getuserbyid.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-getuserbyid.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-getuserbyid
+id: auth-admin-getuserbyid
title: 'getUserById()'
-slug: /auth-api-getuserbyid
+slug: /auth-admin-getuserbyid
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Get user by id.
```js
-const { user, error } = await supabase.auth.api.getUserById(1)
+const { user, error } = await supabase.auth.admin.getUserById(1)
```
## Parameters
@@ -53,5 +53,5 @@ This function should only be called on a server. Never expose your `service_role
### Fetch the user object using the access_token jwt.
```js
-const { user, error } = await supabase.auth.api.getUserById(1)
+const { user, error } = await supabase.auth.admin.getUserById(1)
```
diff --git a/apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx b/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
similarity index 94%
rename from apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
index 0cd2d0c6951..04022857529 100644
--- a/apps/reference/_supabase_js/generated/auth-api-inviteuserbyemail.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-inviteuserbyemail
+id: auth-admin-inviteuserbyemail
title: 'inviteUserByEmail()'
-slug: /auth-api-inviteuserbyemail
+slug: /auth-admin-inviteuserbyemail
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -111,7 +111,7 @@ A URL or mobile address to send the user to after they are confirmed.
### Basic example.
```js
-const { data: user, error } = await supabase.auth.api.inviteUserByEmail(
+const { data, error } = await supabase.auth.admin.inviteUserByEmail(
'email@example.com'
)
```
diff --git a/apps/reference/_supabase_js/generated/auth-api-listusers.mdx b/apps/reference/_supabase_js/generated/auth-admin-listusers.mdx
similarity index 73%
rename from apps/reference/_supabase_js/generated/auth-api-listusers.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-listusers.mdx
index 8cb73a91217..ffaaef8e50d 100644
--- a/apps/reference/_supabase_js/generated/auth-api-listusers.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-listusers.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-listusers
+id: auth-admin-listusers
title: 'listUsers()'
-slug: /auth-api-listusers
+slug: /auth-admin-listusers
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -13,7 +13,7 @@ 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()
+const { data: user, error } = await supabase.auth.admin.listUsers()
```
## Notes
@@ -26,5 +26,5 @@ const { data: user, error } = await supabase.auth.api.listUsers()
### Get a full list of users.
```js
-const { data: user, error } = await supabase.auth.api.listUsers()
+const { data: user, error } = await supabase.auth.admin.listUsers()
```
diff --git a/apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx b/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
similarity index 92%
rename from apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx
rename to apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
index 2e55fc9ad9d..7a6d34d80ae 100644
--- a/apps/reference/_supabase_js/generated/auth-api-updateuserbyid.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-updateuserbyid
+id: auth-admin-updateuserbyid
title: 'updateUserById()'
-slug: /auth-api-updateuserbyid
+slug: /auth-admin-updateuserbyid
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Updates the user data.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ email: 'new@email.com' }
)
@@ -274,7 +274,7 @@ this attribute is used instead of UserAttributes data.
### Updates a user's email.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ email: 'new@email.com' }
)
@@ -283,7 +283,7 @@ const { data: user, error } = await supabase.auth.api.updateUserById(
### Updates a user's password.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ password: 'new_password' }
)
@@ -292,7 +292,7 @@ const { data: user, error } = await supabase.auth.api.updateUserById(
### Updates a user's metadata.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ user_metadata: { hello: 'world' } }
)
@@ -301,7 +301,7 @@ const { data: user, error } = await supabase.auth.api.updateUserById(
### Updates a user's app_metadata.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ app_metadata: { plan: 'trial' } }
)
@@ -310,7 +310,7 @@ const { data: user, error } = await supabase.auth.api.updateUserById(
### Confirms a user's email address.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ email_confirm: true }
)
@@ -319,7 +319,7 @@ const { data: user, error } = await supabase.auth.api.updateUserById(
### Confirms a user's phone number.
```js
-const { data: user, error } = await supabase.auth.api.updateUserById(
+const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ phone_confirm: true }
)
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
-
-
-
-
-
-
- jwt
-
-
- required
-
-
- string
-
-
-
-
-A valid, logged-in JWT. Typically, the access_token for the currentSession
-
-
-
-
-
-
-
-## 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-getsession.mdx b/apps/reference/_supabase_js/generated/auth-getsession.mdx
index 5d8d38d679f..0a490a10c04 100644
--- a/apps/reference/_supabase_js/generated/auth-getsession.mdx
+++ b/apps/reference/_supabase_js/generated/auth-getsession.mdx
@@ -12,7 +12,7 @@ Returns the session data, refreshing it if necessary.
If no session is detected, the session returned will be null.
```js
-const session = supabase.auth.session()
+const { data, error } = supabase.auth.getSession()
```
## Examples
@@ -20,5 +20,5 @@ const session = supabase.auth.session()
### Get the session data
```js
-const session = supabase.auth.session()
+const { data, error } = supabase.auth.getSession()
```
diff --git a/apps/reference/_supabase_js/generated/auth-getuser.mdx b/apps/reference/_supabase_js/generated/auth-getuser.mdx
index 70cae039358..eecf7850f6f 100644
--- a/apps/reference/_supabase_js/generated/auth-getuser.mdx
+++ b/apps/reference/_supabase_js/generated/auth-getuser.mdx
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Gets the current user details if there is an existing session.
```js
-const user = await supabase.auth.getUser()
+const user = supabase.auth.getUser()
```
## Parameters
@@ -42,12 +42,19 @@ Takes in an optional access token jwt. If no jwt is provided, getUser() will att
## Notes
-This method gets the user object from memory.
+- This method gets the user object using the current session.
+- Fetches the user object from the database instead of local storage.
## Examples
-### Get the logged in user
+### Get the logged in user with the current existing session
```js
-const user = await supabase.auth.getUser()
+const user = supabase.auth.getUser()
+```
+
+### Get the logged in user with a custom access token jwt.
+
+```js
+const user = supabase.auth.getUser(jwt)
```
diff --git a/apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx b/apps/reference/_supabase_js/generated/auth-resetpasswordforemail.mdx
similarity index 85%
rename from apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx
rename to apps/reference/_supabase_js/generated/auth-resetpasswordforemail.mdx
index 79be4e6db18..ebdec52c8f0 100644
--- a/apps/reference/_supabase_js/generated/auth-api-resetpasswordforemail.mdx
+++ b/apps/reference/_supabase_js/generated/auth-resetpasswordforemail.mdx
@@ -1,7 +1,7 @@
---
-id: auth-api-resetpasswordforemail
+id: auth-resetpasswordforemail
title: 'resetPasswordForEmail()'
-slug: /auth-api-resetpasswordforemail
+slug: /auth-resetpasswordforemail
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
@@ -11,9 +11,9 @@ 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'
-)
+const { error, data } = await supabase.auth.resetPasswordForEmail(email, options: {
+ redirectTo: 'https://example.com/update-password',
+})
```
## Parameters
@@ -111,7 +111,7 @@ A URL to send the user to after they are confirmed.
Sends a reset request to an email address.
-When the user clicks the reset link in the email they will be forwarded to:
+When the user clicks the reset link in the email they will be forwarded to the site url or the redirect url specified:
`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
@@ -120,7 +120,7 @@ Your app must detect `type=recovery` in the fragment and display a password rese
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, {
+const { error, data } = await supabase.auth.updateUser({
password: new_password,
})
```
@@ -130,7 +130,7 @@ const { error, data } = await supabase.auth.api.updateUser(access_token, {
### Reset password
```js
-const { data, error } = await supabase.auth.api.resetPasswordForEmail(
- 'user@email.com'
-)
+const { error, data } = await supabase.auth.resetPasswordForEmail(email, options: {
+ redirectTo: 'https://example.com/update-password',
+})
```
diff --git a/apps/reference/_supabase_js/generated/auth-setsession.mdx b/apps/reference/_supabase_js/generated/auth-setsession.mdx
index 8620b77dac4..7b6da3a7aa0 100644
--- a/apps/reference/_supabase_js/generated/auth-setsession.mdx
+++ b/apps/reference/_supabase_js/generated/auth-setsession.mdx
@@ -11,16 +11,7 @@ import TabItem from '@theme/TabItem'
Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
```js
-function apiFunction(req, res) {
- // Assuming the access token was sent as a header "X-Supabase-Auth"
- const { access_token } = req.get('X-Supabase-Auth')
-
- // You can now use it within a Supabase Client
- const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key")
- const { user, error } = supabase.auth.setAuth(access_token)
-
- // This client will now send requests as this user
- const { data } = await supabase.from('your_table').select()
+ const { data, error } = supabase.auth.setSession(refresh_token)
}
```
@@ -54,57 +45,9 @@ The refresh token returned by gotrue.
### Basic example.
-This is most useful on server-side functions where you cannot log the user in, but have access to the user's access token.
+Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
```js
-function apiFunction(req, res) {
- // Assuming the access token was sent as a header "X-Supabase-Auth"
- const { access_token } = req.get('X-Supabase-Auth')
-
- // You can now use it within a Supabase Client
- const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key")
- const { user, error } = supabase.auth.setAuth(access_token)
-
- // This client will now send requests as this user
- const { data } = await supabase.from('your_table').select()
-}
-```
-
-### With Express.
-
-```js
-/**
- * Make a request from the client to your server function
- */
-async function makeApiRequest() {
- const token = newClient.session()?.access_token
-
- await fetch('https://example.com/withAuth', {
- method: 'GET',
- withCredentials: true,
- credentials: 'include',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: bearer, // Your own auth
- 'X-Supabase-Auth': token, // Set the Supabase user
- },
- })
-}
-
-/**
- * Use the Auth token in your server-side function.
- */
-async function apiFunction(req, res) {
- const { access_token } = req.get('X-Supabase-Auth')
-
- // You can now use it within a Supabase Client
- const supabase = createClient(
- 'https://xyzcompany.supabase.co',
- 'public-anon-key'
- )
- const { user, error } = supabase.auth.setAuth(access_token)
-
- // This client will now send requests as this user
- const { data } = await supabase.from('your_table').select()
+ const { data, error } = supabase.auth.setSession(refresh_token)
}
```
diff --git a/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx b/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
index 3f836b61d57..61a4002a9c3 100644
--- a/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
@@ -10,13 +10,6 @@ import TabItem from '@theme/TabItem'
Log in an existing user via a third-party provider.
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
-})
-```
-
## Parameters
@@ -155,71 +148,32 @@ A space-separated list of scopes granted to the OAuth application.
## Notes
-- A user can sign up either via email or OAuth.
-- If you provide `email` without a `password`, the user will be sent a magic link.
-- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
-- Specifying a `provider` will open the browser to the relevant login page.
+- This method is used for signing in using a third-party provider.
+- Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
## Examples
-### Sign in with email.
+### Sign in using a third-party provider.
```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
-})
-```
-
-### Sign in with magic link.
-
-If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
-})
-```
-
-### Sign in using third-party providers.
-
-Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
+const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github',
})
```
-### Sign in with Phone.
+### Sign in using a third-party provider with redirect.
-Supabase supports Phone Auth.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-### Sign in with redirect.
-
-Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
-the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
-Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
+The `redirectTo` param will only applied on the callback made from the third-party provider. It does not redirect the user immediately after invoking this method.
+In order for the `redirectTo` param to be allowed, one needs to include it in an allowlist. Supabase supports this for
any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- redirectTo: 'https://example.com/welcome',
+const { user, session, error } = await supabase.auth.signInWithOAuth({
+ provider: 'github'
+ options: {
+ redirectTo: 'https://example.com/welcome'
}
-)
+}
```
### Sign in with scopes.
@@ -228,33 +182,11 @@ If you need additional data from an OAuth provider, you can include a space-sepa
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- scopes: 'repo gist notifications',
+const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'github'
+ options: {
+ scopes: 'repo gist notifications'
}
-)
-const oAuthToken = session.provider_token // use to access provider API
-```
-
-### Sign in using a refresh token (e.g. in React Native).
-
-If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
-
-```js
-// An example using Expo's `AuthSession`
-const redirectUri = AuthSession.makeRedirectUri({ useProxy: false })
-const provider = 'google'
-
-AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
-}).then(async (response: any) => {
- if (!response) return
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- })
})
+const oAuthToken = data.session.provider_token // use to access provider API
```
diff --git a/apps/reference/_supabase_js/generated/auth-signinwithotp.mdx b/apps/reference/_supabase_js/generated/auth-signinwithotp.mdx
index 5cc5828a8cd..4e77198b6c2 100644
--- a/apps/reference/_supabase_js/generated/auth-signinwithotp.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signinwithotp.mdx
@@ -11,9 +11,8 @@ import TabItem from '@theme/TabItem'
Passwordless method for logging in an existing user.
```js
-const { user, session, error } = await supabase.auth.signIn({
+const { data, error } = await supabase.auth.signInWithOtp({
email: 'example@email.com',
- password: 'example-password',
})
```
@@ -175,106 +174,30 @@ If set to false, this method will not create a new user. Defaults to true.
## Notes
-- A user can sign up either via email or OAuth.
-- If you provide `email` without a `password`, the user will be sent a magic link.
+- This method is used for passwordless sign-ins where an otp is sent to the user's email or phone number.
+- Requires either an email or phone number.
+- If you're using an email, you can configure whether you want the user to receive a magiclink or an otp.
+- If you're using phone, you can configure whether you want the user to receive a magiclink or an otp.
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
-- Specifying a `provider` will open the browser to the relevant login page.
## Examples
### Sign in with email.
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
-})
-```
-
-### Sign in with magic link.
-
-If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
+The user will be sent an otp to their email. By default, a given user can only request an otp once every 60 seconds.
```js
-const { user, session, error } = await supabase.auth.signIn({
+const { data, error } = await supabase.auth.signInWithOtp({
email: 'example@email.com',
})
```
-### Sign in using third-party providers.
+### Sign in with sms otp.
-Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
+The user will be sent an otp to their phone number. By default, a given user can only request an otp once every 60 seconds.
```js
-const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
- provider: 'github',
-})
-```
-
-### Sign in with Phone.
-
-Supabase supports Phone Auth.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
+const { data, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-### Sign in with redirect.
-
-Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
-the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
-Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
-any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
-
-```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- redirectTo: 'https://example.com/welcome',
- }
-)
-```
-
-### Sign in with scopes.
-
-If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
-You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
-
-```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- scopes: 'repo gist notifications',
- }
-)
-const oAuthToken = session.provider_token // use to access provider API
-```
-
-### Sign in using a refresh token (e.g. in React Native).
-
-If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
-
-```js
-// An example using Expo's `AuthSession`
-const redirectUri = AuthSession.makeRedirectUri({ useProxy: false })
-const provider = 'google'
-
-AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
-}).then(async (response: any) => {
- if (!response) return
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- })
})
```
diff --git a/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx b/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
index 77e4c92cdab..bd7abe414af 100644
--- a/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
@@ -10,13 +10,6 @@ import TabItem from '@theme/TabItem'
Log in an existing user, or login via a third-party provider.
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
-})
-```
-
## Parameters
@@ -155,106 +148,4 @@ Verification token received when the user completes the captcha on the site.
## Notes
-- A user can sign up either via email or OAuth.
-- If you provide `email` without a `password`, the user will be sent a magic link.
-- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
-- Specifying a `provider` will open the browser to the relevant login page.
-
-## Examples
-
-### Sign in with email.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
-})
-```
-
-### Sign in with magic link.
-
-If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
-})
-```
-
-### Sign in using third-party providers.
-
-Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
- provider: 'github',
-})
-```
-
-### Sign in with Phone.
-
-Supabase supports Phone Auth.
-
-```js
-const { user, session, error } = await supabase.auth.signIn({
- phone: '+13334445555',
- password: 'some-password',
-})
-```
-
-### Sign in with redirect.
-
-Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
-the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
-Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
-any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
-
-```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- redirectTo: 'https://example.com/welcome',
- }
-)
-```
-
-### Sign in with scopes.
-
-If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
-You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
-
-```js
-const { user, session, error } = await supabase.auth.signIn(
- {
- provider: 'github',
- },
- {
- scopes: 'repo gist notifications',
- }
-)
-const oAuthToken = session.provider_token // use to access provider API
-```
-
-### Sign in using a refresh token (e.g. in React Native).
-
-If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
-
-```js
-// An example using Expo's `AuthSession`
-const redirectUri = AuthSession.makeRedirectUri({ useProxy: false })
-const provider = 'google'
-
-AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
-}).then(async (response: any) => {
- if (!response) return
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- })
-})
-```
+- Requires either an email and password or a phone number and password.
diff --git a/apps/reference/_supabase_js/generated/auth-signup.mdx b/apps/reference/_supabase_js/generated/auth-signup.mdx
index 061e3da0419..d7a4065a3ff 100644
--- a/apps/reference/_supabase_js/generated/auth-signup.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signup.mdx
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Creates a new user.
```js
-const { user, session, error } = await supabase.auth.signUp({
+const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
})
@@ -209,7 +209,7 @@ The redirect url embedded in the email link
### Sign up.
```js
-const { user, session, error } = await supabase.auth.signUp({
+const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
})
@@ -218,37 +218,14 @@ const { user, session, error } = await supabase.auth.signUp({
### Sign up with additional user meta data.
```js
-const { user, session, error } = await supabase.auth.signUp(
- {
- email: 'example@email.com',
- password: 'example-password',
- },
- {
+const { data, error } = await supabase.auth.signUp({
+ email: 'example@email.com',
+ password: 'example-password',
+ options: {
data: {
first_name: 'John',
age: 27,
},
- }
-)
-```
-
-### Sign up with third-party providers.
-
-You can sign up with OAuth providers using the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-third-party-providers) method.
-
-### Sign up with Phone.
-
-Supabase supports Phone Auth. After a user has verified their number, they can use the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
-
-```js
-const { user, session, error } = await supabase.auth.signUp({
- phone: '+13334445555',
- password: 'some-password',
-})
-
-// After receiving an SMS with One Time Password.
-let { session, error } = await supabase.auth.verifyOTP({
- phone: '+13334445555',
- token: '123456',
+ },
})
```
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/_supabase_js/generated/auth-updateuser.mdx b/apps/reference/_supabase_js/generated/auth-updateuser.mdx
index fa19294716f..6d684ad1781 100644
--- a/apps/reference/_supabase_js/generated/auth-updateuser.mdx
+++ b/apps/reference/_supabase_js/generated/auth-updateuser.mdx
@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
Updates user data, if there is a logged in user.
```js
-const { user, error } = await supabase.auth.updateUser({
+const { data, error } = await supabase.auth.updateUser({
email: 'new@email.com',
})
```
@@ -162,7 +162,7 @@ Use the `update()` method if you have data which rarely changes or is specific o
Sends a "Confirm Email Change" email to the new email address.
```js
-const { user, error } = await supabase.auth.updateUser({
+const { data, error } = await supabase.auth.updateUser({
email: 'new@email.com',
})
```
@@ -170,7 +170,7 @@ const { user, error } = await supabase.auth.updateUser({
### Update password for authenticated user.
```js
-const { user, error } = await supabase.auth.updateUser({
+const { data, error } = await supabase.auth.updateUser({
password: 'new password',
})
```
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..a0b48c82648 100644
--- a/apps/reference/_supabase_js/release-notes.md
+++ b/apps/reference/_supabase_js/release-notes.md
@@ -4,8 +4,213 @@ 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,
+ },
+})
+```
+
+### 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).
+
+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()` 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).
+
+### 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
+}
+```
+
+### 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))
+
+### 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)).
+- `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.
diff --git a/apps/reference/docs/about.mdx b/apps/reference/docs/about.mdx
index ad07450e6d4..6574d49f5b5 100755
--- a/apps/reference/docs/about.mdx
+++ b/apps/reference/docs/about.mdx
@@ -32,13 +32,13 @@ const frameworks = [
{
name: 'Expo',
logo: ExpoLogo,
- href: 'https://github.com/supabase/supabase/tree/master/examples/todo-list/expo-todo-list',
+ href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list',
},
{ name: 'Flutter', logo: DartLogo, href: '/guides/with-flutter' },
{
name: 'JavaScript',
logo: JavascriptLogo,
- href: 'https://github.com/supabase/supabase/tree/master/examples/auth/javascript-auth',
+ href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth',
},
{
name: 'Next.js',
diff --git a/apps/reference/docs/guides/examples.mdx b/apps/reference/docs/guides/examples.mdx
index efb02e32459..13bc61a4d3a 100644
--- a/apps/reference/docs/guides/examples.mdx
+++ b/apps/reference/docs/guides/examples.mdx
@@ -4,7 +4,7 @@ title: Examples and Resources
description: 'Examples you can use to get started with Supabase'
---
-We have a [set of examples](https://github.com/supabase/supabase/tree/master/examples) in our [main repository](https://github.com/supabase/supabase) to help you get started.
+We have a [set of examples](https://github.com/supabase/examples) in our [main repository](https://github.com/supabase/supabase) to help you get started.
## Featured
@@ -53,23 +53,23 @@ By [Fireship](https://www.youtube.com/watch?v=WiwfiVdfRIc).
Build a basic Todo List with Supabase and your favorite frontend framework:
-- [Expo Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/expo-todo-list)
-- [Next.js Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/nextjs-todo-list)
-- [React Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/react-todo-list)
-- [Svelte Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list)
-- [Vue 3 Todo List (Typescript).](https://github.com/supabase/supabase/tree/master/examples/todo-list/vue3-ts-todo-list)
-- [Angular Todo List.](https://github.com/supabase/supabase/tree/master/examples/todo-list/angular-todo-list)
+- [Expo Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list)
+- [Next.js Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/nextjs-todo-list)
+- [React Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-todo-list)
+- [Svelte Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/sveltejs-todo-list)
+- [Vue 3 Todo List (Typescript).](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list)
+- [Angular Todo List.](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/angular-todo-list)
- [Nuxt 3 Todo List.](https://github.com/nuxt-community/supabase-module/tree/main/demo)
### Auth examples
-- [Supabase Auth with vanilla JavaScript.](https://github.com/supabase/supabase/tree/master/examples/auth/javascript-auth). Use Supabase without any frontend frameworks.
-- [Supabase Auth with Next.js SSR.](https://github.com/supabase/supabase/tree/master/examples/nextjs-with-supabase-auth) Uses cookies to persist auth between the server and the client.
+- [Supabase Auth with vanilla JavaScript.](https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth). Use Supabase without any frontend frameworks.
+- [Supabase Auth with Next.js SSR.](https://github.com/supabase/examples/tree/main/supabase-js-v1/nextjs-with-supabase-auth) Uses cookies to persist auth between the server and the client.
- [Supabase Auth with RedwoodJS.](https://redwood-playground-auth.netlify.app/supabase) Try out Supabase authentication in the [RedwoodJS](https://redwoodjs.com) Authentication Playground complete with OAuth support and code samples.
### Collaborative
-- [Next.js Slack Clone.](https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone)
+- [Next.js Slack Clone.](https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone)
## Community
@@ -115,7 +115,7 @@ Build a basic Todo List with Supabase and your favorite frontend framework:
- Supabase + Svelte Trello clone. [GitHub](https://github.com/joshnuss/supabase-kanban)
- Supabase + Expo Starter. [GitHub](https://github.com/codingki/react-native-expo-template/tree/master/template-typescript-bottom-tabs-supabase-auth-flow)
- Supabase + Nest.js. [GitHub](https://github.com/hiro1107/nestjs-supabase-auth)
-- Supabase + Cloudflare Workers. [GitHub](https://github.com/supabase/supabase/tree/master/examples/with-cloudflare-workers)
+- Supabase + Cloudflare Workers. [GitHub](https://github.com/supabase/examples/tree/main/supabase-js-v1/with-cloudflare-workers)
- Supabase + Cloudflare Workers + Webpack. [GitHub](https://github.com/signalnerve/supabase-workers-proxy)
- Realtime chat app with Supabase + React. [GitHub](https://github.com/shwosner/realtime-chat-supabase-react)
- Repository.surf: GitHub insights dashboard. [GitHub](https://github.com/supabase/repository.surf)
diff --git a/apps/reference/docs/guides/functions.mdx b/apps/reference/docs/guides/functions.mdx
index 0d2e8a576e6..a6d20d8452f 100644
--- a/apps/reference/docs/guides/functions.mdx
+++ b/apps/reference/docs/guides/functions.mdx
@@ -10,12 +10,12 @@ const examples = [
{
name: 'With supabase-js',
description: 'Use the Supabase client inside your Edge Function.',
- href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions',
+ href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions',
},
{
name: 'With CORS headers',
description: 'Send CORS headers for invoking from the browser.',
- href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/browser-with-cors/index.ts',
+ href: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/browser-with-cors',
},
{
name: 'React Native with Stripe',
@@ -88,7 +88,7 @@ The command outputs a URL to the Supabase Dashboard which you can open to find v
By default Edge Functions require a valid JWT to be send in the authorization header. This header is automatically set when invoking your function via a Supabase client library.
-If you want to use Edge Functions to handle webhooks (e.g. [Stripe payment webhooks](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/stripe-webhooks), or [chat bot webhooks](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/telegram-bot) etc.), you need to pass the `--no-verify-jwt` flag when deploying your function.
+If you want to use Edge Functions to handle webhooks (e.g. [Stripe payment webhooks](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/stripe-webhooks), or [chat bot webhooks](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/telegram-bot) etc.), you need to pass the `--no-verify-jwt` flag when deploying your function.
:::
@@ -235,7 +235,7 @@ supabase secrets list
## Examples
-You can find a list of useful [Edge Function Examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions) in our GitHub repository.
+You can find a list of useful [Edge Function Examples](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions) in our GitHub repository.
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/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())
diff --git a/apps/reference/docs/guides/with-nextjs.mdx b/apps/reference/docs/guides/with-nextjs.mdx
index 0f82541674a..8607016a079 100644
--- a/apps/reference/docs/guides/with-nextjs.mdx
+++ b/apps/reference/docs/guides/with-nextjs.mdx
@@ -214,7 +214,7 @@ export default function Auth() {
const handleLogin = async (email) => {
try {
setLoading(true)
- const { error } = await supabase.auth.signIn({ email })
+ const { error } = await supabase.auth.signInWithOtp({ email })
if (error) throw error
alert('Check your email for the login link!')
} catch (error) {
@@ -278,10 +278,27 @@ export default function Account({ session }) {
getProfile()
}, [session])
+ async function getCurrentUser() {
+ const {
+ data: { session },
+ error,
+ } = await supabase.auth.getSession()
+
+ if (error) {
+ throw error
+ }
+
+ if (!session?.user) {
+ throw new Error('User not logged in')
+ }
+
+ return session.user
+ }
+
async function getProfile() {
try {
setLoading(true)
- const user = supabase.auth.user()
+ const user = await getCurrentUser()
let { data, error, status } = await supabase
.from('profiles')
@@ -308,7 +325,7 @@ export default function Account({ session }) {
async function updateProfile({ username, website, avatar_url }) {
try {
setLoading(true)
- const user = supabase.auth.user()
+ const user = await getCurrentUser()
const updates = {
id: user.id,
@@ -318,9 +335,7 @@ export default function Account({ session }) {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates, {
- returning: 'minimal', // Don't return the value after inserting
- })
+ let { error } = await supabase.from('profiles').upsert(updates)
if (error) {
throw error
@@ -391,14 +406,40 @@ import Auth from '../components/Auth'
import Account from '../components/Account'
export default function Home() {
+ const [isLoading, setIsLoading] = useState(true)
const [session, setSession] = useState(null)
useEffect(() => {
- setSession(supabase.auth.session())
+ let mounted = true
- supabase.auth.onAuthStateChange((_event, session) => {
- setSession(session)
- })
+ async function getInitialSession() {
+ const {
+ data: { session },
+ } = await supabase.auth.getSession()
+
+ // only update the react state if the component is still mounted
+ if (mounted) {
+ if (session) {
+ setSession(session)
+ }
+
+ setIsLoading(false)
+ }
+ }
+
+ getInitialSession()
+
+ const { subscription } = supabase.auth.onAuthStateChange(
+ (_event, session) => {
+ setSession(session)
+ }
+ )
+
+ return () => {
+ mounted = false
+
+ subscription?.unsubscribe()
+ }
}, [])
return (
diff --git a/apps/reference/nav/supabase_js_sidebars.js b/apps/reference/nav/supabase_js_sidebars.js
index 93e5c785c99..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,
},
@@ -41,11 +40,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 +52,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/_blog/2021-03-02-supabase-beta-february-2021.mdx b/apps/www/_blog/2021-03-02-supabase-beta-february-2021.mdx
index 5a184600c47..35bb2236f89 100644
--- a/apps/www/_blog/2021-03-02-supabase-beta-february-2021.mdx
+++ b/apps/www/_blog/2021-03-02-supabase-beta-february-2021.mdx
@@ -78,9 +78,9 @@ Launch your database in South Africa.
### Community
-One of the community, [@ftonato](https://github.com/ftonato), has built an amazing [example](https://github.com/supabase/supabase/tree/master/examples/with-stencil) that shows how to use Supabase with [Stencil](https://stenciljs.com/) (a Web Component compiler built by they [Ionic](https://ionicframework.com/) team.)
+One of the community, [@ftonato](https://github.com/ftonato), has built an amazing [example](https://github.com/supabase/examples/tree/main/supabase-js-v1/with-stencil) that shows how to use Supabase with [Stencil](https://stenciljs.com/) (a Web Component compiler built by they [Ionic](https://ionicframework.com/) team.)
-[Check it out!](https://github.com/supabase/supabase/tree/master/examples/with-stencil)
+[Check it out!](https://github.com/supabase/examples/tree/main/supabase-js-v1/with-stencil)

diff --git a/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx b/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx
index 073fad6dbb0..6f4eb3c9995 100644
--- a/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx
+++ b/apps/www/_blog/2021-04-06-supabase-beta-march-2021.mdx
@@ -95,7 +95,7 @@ Thanks to a comunity contribution ([@\_mateomorris](https://twitter.com/_mateomo
- Ionic Integration by [Simon Grimm](https://www.youtube.com/user/saimon1924) [[Video](https://www.youtube.com/watch?v=pl9XfIWutKE)]
- Flutter Integration by [Aditya Thakur](https://www.youtube.com/channel/UChCAJNpMwoEUYCsE_eSyU4w) by [[Video](https://www.youtube.com/watch?v=fqfHEZvQPlY)]
- Svelte Integration by [Khaerunnisa Isnaeni](https://www.youtube.com/channel/UCqNDj6eQeTLHuEwgEHWOGjw) [[Video](https://www.youtube.com/watch?v=odPYzJJyEJI)]
-- An [example app](https://github.com/supabase/supabase/tree/master/examples/nextjs-ts-user-management) for adding User Profiles to your Next.js app
+- An [example app](https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management) for adding User Profiles to your Next.js app

diff --git a/apps/www/_blog/2022-02-22-supabase-beta-january-2022.mdx b/apps/www/_blog/2022-02-22-supabase-beta-january-2022.mdx
index da70c2b978c..8615f4d2e40 100644
--- a/apps/www/_blog/2022-02-22-supabase-beta-january-2022.mdx
+++ b/apps/www/_blog/2022-02-22-supabase-beta-january-2022.mdx
@@ -95,12 +95,12 @@ type AccountHolder {
It’s all anyone seems to be [talking about](https://twitter.com/jkup/status/1456360115205033989). We genuinely love what [Remix](https://remix.run/) are doing, so it’s only right that we show off how Remix and Supabase work well together.
-Check out the new [Remix Auth example](https://github.com/supabase/supabase/tree/master/examples/remix-auth), and let us know what you think.
+Check out the new [Remix Auth example](https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/remix-auth), and let us know what you think.
### Expo Todo List
Our React Native example has been correctly updated to be an Expo example.
-[Check it out here](https://github.com/supabase/supabase/tree/master/examples/todo-list/expo-todo-list).
+[Check it out here](https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list).
## Video: API requests with Database Webhooks
diff --git a/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx b/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx
index fe17cc6ef21..17965805b2a 100644
--- a/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx
+++ b/apps/www/_blog/2022-03-31-supabase-edge-functions.mdx
@@ -98,7 +98,7 @@ Our observability pipeline has been built [using Logflare](https://supabase.com/

new —> deploy —> invoke —> logs
-To round off the end-to-end experience, `supabase-js` now works in Deno, making it easy to interact with the rest of your Supabase project from within your Edge Functions. Your project's URLs, API keys, and database connection strings are made available as environment variables within your Function to make this even easier. And if you want to interact with third-party APIs which require a secret key, such as Stripe, you can easily and securely make these available to your Function as environment variables via the Supabase CLI. To get an idea for what is possible, check out our examples page [here](https://github.com/supabase/supabase/tree/master/examples/edge-functions).
+To round off the end-to-end experience, `supabase-js` now works in Deno, making it easy to interact with the rest of your Supabase project from within your Edge Functions. Your project's URLs, API keys, and database connection strings are made available as environment variables within your Function to make this even easier. And if you want to interact with third-party APIs which require a secret key, such as Stripe, you can easily and securely make these available to your Function as environment variables via the Supabase CLI. To get an idea for what is possible, check out our examples page [here](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions).
## Quickstart
diff --git a/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx b/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx
index 31ab4628aae..138ef0de773 100644
--- a/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx
+++ b/apps/www/_blog/2022-04-01-hackathon-bring-the-func.mdx
@@ -132,7 +132,7 @@ Here's a collection of resources that will help you get started building with Su
- [Edge Functions Guide](https://supabase.com/docs/guides/functions)
- [Edge Functions Quickstart video](https://youtu.be/rzglqRdZUQE)
- [Supabase CLI local development guide](https://supabase.com/docs/guides/local-development)
-- [Edge Functions examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions)
+- [Edge Functions examples](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions)
### Additional Info
diff --git a/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx b/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx
index 603cb16ea8f..249fa8b6ea1 100644
--- a/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx
+++ b/apps/www/_blog/2022-04-18-bring-the-func-hackathon-winners.mdx
@@ -99,6 +99,6 @@ If you're inspired to build, check out some of the latest resources:
- [Edge Functions Guide](https://supabase.com/docs/guides/functions)
- [Edge Functions Quickstart video](https://youtu.be/rzglqRdZUQE)
- [Supabase CLI local development guide](https://supabase.com/docs/guides/local-development)
-- [Edge Functions examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions)
+- [Edge Functions examples](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions)
[^1]: Updated on June 14 2022 for search optimization: Removed links as account does not exist anymore on GitHub
diff --git a/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx b/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx
index c3b70e34898..8651a209a51 100644
--- a/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx
+++ b/apps/www/_blog/2022-06-07-beta-update-may-2022.mdx
@@ -20,9 +20,9 @@ Wildcard redirects are especially useful for Jamstack platforms with preview dep
## Supabase Edge functions with Webhooks
-Now you can deploy functions with optional JWT verification. This makes it easier to trigger Edge Functions with webhooks. Use the -no-verify-jwt flag when deploying your functions via the CLI to enable this mode. You can test this out with our [Edge Functions Telegram Bot example](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/telegram-bot).
+Now you can deploy functions with optional JWT verification. This makes it easier to trigger Edge Functions with webhooks. Use the -no-verify-jwt flag when deploying your functions via the CLI to enable this mode. You can test this out with our [Edge Functions Telegram Bot example](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/telegram-bot).
-[](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/telegram-bot)
+[](https://github.com/supabase/examples/tree/main/supabase-js-v1/edge-functions/supabase/functions/telegram-bot)
## Metrics for everybody
@@ -39,7 +39,7 @@ The Policy editor now includes a “Target roles” field. We now have a strong
## State of DB 2022
Basedash conducted a survey that takes the pulse of the current databases that teams, individuals, startups, enterprises and hobbyists are using.
-
+
Supabase was listed in two categories, including the first place in satisfaction for hosting providers (84% of users would use us again 🙏). [Full results](https://stateofdb.com/).
[](https://stateofdb.com/)
@@ -67,7 +67,7 @@ There is an opportunity to work inside the growth team at Supabase. It's still a
### Deepnote
Deepnote is a data notebook that’s built for collaboration — Jupyter compatible, works magically in the cloud, and sharing is as easy as sending a link.
-
+
You can connect your Supabase Postgres Database to your Deepnote notebooks to quickly analyze data and share your findings with others. [Check out the guide](https://docs.deepnote.com/integrations/supabase).
[](https://docs.deepnote.com/integrations/supabase)
diff --git a/apps/www/components/BuiltWithSupabase/index.tsx b/apps/www/components/BuiltWithSupabase/index.tsx
index f6d5541a538..25278aea0a1 100644
--- a/apps/www/components/BuiltWithSupabase/index.tsx
+++ b/apps/www/components/BuiltWithSupabase/index.tsx
@@ -21,8 +21,8 @@ const BuiltExamples = () => {
} size="small">
diff --git a/apps/www/components/Sections/GithubExamples.tsx b/apps/www/components/Sections/GithubExamples.tsx
index bbf0686b155..c1ced5548e4 100644
--- a/apps/www/components/Sections/GithubExamples.tsx
+++ b/apps/www/components/Sections/GithubExamples.tsx
@@ -42,8 +42,8 @@ function GithubExamples() {
}>
Official GitHub library
diff --git a/apps/www/data/CodeExamples.ts b/apps/www/data/CodeExamples.ts
index e1002e9cbd0..2e81a24c2c9 100644
--- a/apps/www/data/CodeExamples.ts
+++ b/apps/www/data/CodeExamples.ts
@@ -23,7 +23,7 @@ export const createUserExample: ExampleProps = {
const supabase = createClient(supabaseUrl, supabaseKey)
// Create a new user
- const { user, error } = await supabase.auth.signUp({
+ const { user, error } = await supabase.auth.signUpWithPassword({
email: 'example@email.com',
password: 'example-password',
})
diff --git a/apps/www/data/Examples.json b/apps/www/data/Examples.json
index 7713c9d9b0b..7a590586647 100644
--- a/apps/www/data/Examples.json
+++ b/apps/www/data/Examples.json
@@ -21,7 +21,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "nextjs-slack-clone",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone",
"vercel_deploy_url": "",
"demo_url": ""
},
@@ -86,7 +86,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "javascript-auth",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/auth/javascript-auth",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth",
"vercel_deploy_url": "",
"demo_url": "https://auth-vanilla-js.vercel.app/"
},
@@ -99,7 +99,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "expo-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/expo-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-native-ts-todo-list",
"vercel_deploy_url": "",
"demo_url": ""
},
@@ -112,7 +112,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "nextjs-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/nextjs-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/nextjs-todo-list",
"vercel_deploy_url": "",
"demo_url": "https://supabase-nextjs-todo-list.vercel.app/"
},
@@ -125,7 +125,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "react-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/react-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-todo-list",
"vercel_deploy_url": "",
"demo_url": ""
},
@@ -138,7 +138,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "sveltejs-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/sveltejs-todo-list",
"vercel_deploy_url": "",
"demo_url": ""
},
@@ -151,7 +151,7 @@
"author_url": "https://github.com/supabase",
"author_img": "https://avatars.githubusercontent.com/u/54469796",
"repo_name": "vue3-ts-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/vue3-ts-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list",
"vercel_deploy_url": "",
"demo_url": ""
},
@@ -164,7 +164,7 @@
"author_url": "https://github.com/geromegrignon",
"author_img": "https://avatars.githubusercontent.com/u/32737308",
"repo_name": "angular-todo-list",
- "repo_url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/angular-todo-list",
+ "repo_url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/angular-todo-list",
"vercel_deploy_url": "",
"demo_url": ""
}
diff --git a/apps/www/data/ProjectExamples.json b/apps/www/data/ProjectExamples.json
index 9aa3c14bc91..fe61e2014c5 100644
--- a/apps/www/data/ProjectExamples.json
+++ b/apps/www/data/ProjectExamples.json
@@ -23,7 +23,7 @@
{
"imgUrl": "images/slack-clone.jpg",
"title": "Chat app with Next.js",
- "url": "https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone",
+ "url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/slack-clone/nextjs-slack-clone",
"description": "Build a full-stack Slack clone using Next.js and Supabase.",
"icons": [
{
@@ -40,7 +40,7 @@
{
"imgUrl": "images/to-do-app.jpg",
"title": "Todo list with Vue.js",
- "url": "https://github.com/supabase/supabase/tree/master/examples/todo-list/vue3-ts-todo-list",
+ "url": "https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list",
"description": "Build a simple todo list with Vue and Supabase.",
"icons": [
{
diff --git a/apps/www/data/home/api-examples.js b/apps/www/data/home/api-examples.js
index 2785259c96a..652cfaad0c5 100644
--- a/apps/www/data/home/api-examples.js
+++ b/apps/www/data/home/api-examples.js
@@ -11,7 +11,7 @@ const supabaseKey = 'public-anon-key'
const supabase = createClient(supabaseUrl, supabaseKey)
// Create a new user
-const { user, error } = await supabase.auth.signUp({
+const { user, error } = await supabase.auth.signUpWithPassword({
email: 'example@email.com',
password: 'example-password',
})
diff --git a/apps/www/data/products/auth/auth-api-examples.js b/apps/www/data/products/auth/auth-api-examples.js
index fa745dd414f..937296ac1fd 100644
--- a/apps/www/data/products/auth/auth-api-examples.js
+++ b/apps/www/data/products/auth/auth-api-examples.js
@@ -5,7 +5,7 @@ export default [
description: '',
code: `
// Sign up with email
- const { user, error } = await supabase.auth.signUp({
+ const { user, error } = await supabase.auth.signUpWithPassword({
email: 'example@email.com',
password: 'example-password',
})
diff --git a/apps/www/next.config.js b/apps/www/next.config.js
index acba685a82f..36703af7ae8 100644
--- a/apps/www/next.config.js
+++ b/apps/www/next.config.js
@@ -1413,6 +1413,57 @@ module.exports = withMDX({
source: '/docs/guides/local-development',
destination: '/docs/guides/cli/local-development',
},
+ // 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',
+ // },
]
},
})
diff --git a/apps/www/pages/storage/Storage.tsx b/apps/www/pages/storage/Storage.tsx
index 686d543921a..d3c1fe1925b 100644
--- a/apps/www/pages/storage/Storage.tsx
+++ b/apps/www/pages/storage/Storage.tsx
@@ -155,7 +155,7 @@ function StoragePage() {
author_img={'https://avatars.githubusercontent.com/u/54469796'}
repo_name={'nextjs-ts-user-management'}
repo_url={
- 'https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management'
+ 'https://github.com/supabase/examples/tree/main/supabase-js-v1/user-management/nextjs-ts-user-management'
}
vercel_deploy_url={
'https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fuser-mangement%2Fnextjs-ts-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-nextjs-ts-user-management.vercel.app&demo-image=https%3A%2F%2Fi.imgur.com%2FZ3HkQqe.png&integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv&external-id=nextjs-user-management'
diff --git a/package-lock.json b/package-lock.json
index b5779a21969..48c2fca0e22 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3489,6 +3489,28 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true
},
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"node_modules/@csstools/convert-colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz",
@@ -5007,7 +5029,7 @@
}
},
"node_modules/@supabase/generator": {
- "resolved": "packages/spec",
+ "resolved": "packages/generator",
"link": true
},
"node_modules/@supabase/gotrue-js": {
@@ -5122,6 +5144,30 @@
"node": ">= 6"
}
},
+ "node_modules/@tsconfig/node10": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
+ "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node16": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz",
+ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
+ "dev": true
+ },
"node_modules/@types/babel__core": {
"version": "7.1.19",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz",
@@ -5268,6 +5314,12 @@
"integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
"devOptional": true
},
+ "node_modules/@types/json-stringify-safe": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@types/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz",
+ "integrity": "sha512-UUA1sH0RSRROdInuDOA1yoRzbi5xVFD1RHCoOvNRPTNwR8zBkJ/84PZ6NhKVDtKp0FTeIccJCdQz1X2aJPr4uw==",
+ "dev": true
+ },
"node_modules/@types/json5": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
@@ -9348,6 +9400,12 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
+ "node_modules/hosted-git-info": {
+ "version": "2.8.9",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
+ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
+ "dev": true
+ },
"node_modules/html-encoding-sniffer": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
@@ -10957,6 +11015,12 @@
"node": ">=4"
}
},
+ "node_modules/json-parse-better-errors": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
+ "dev": true
+ },
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@@ -10973,6 +11037,11 @@
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="
},
+ "node_modules/json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="
+ },
"node_modules/json5": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
@@ -11086,6 +11155,52 @@
"node": ">=0.10.0"
}
},
+ "node_modules/load-json-file": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+ "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^4.0.0",
+ "pify": "^3.0.0",
+ "strip-bom": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/load-json-file/node_modules/parse-json": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==",
+ "dev": true,
+ "dependencies": {
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/load-json-file/node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/load-json-file/node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/loader-runner": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
@@ -11582,6 +11697,15 @@
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
},
+ "node_modules/memorystream": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
+ "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -12510,6 +12634,12 @@
"url": "https://opencollective.com/postcss/"
}
},
+ "node_modules/nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
"node_modules/node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@@ -12577,6 +12707,27 @@
"node": ">=6.0.0"
}
},
+ "node_modules/normalize-package-data": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "dev": true,
+ "dependencies": {
+ "hosted-git-info": "^2.1.4",
+ "resolve": "^1.10.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
+ "node_modules/normalize-package-data/node_modules/semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -12593,6 +12744,125 @@
"node": ">=0.10.0"
}
},
+ "node_modules/npm-run-all": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
+ "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "chalk": "^2.4.1",
+ "cross-spawn": "^6.0.5",
+ "memorystream": "^0.3.1",
+ "minimatch": "^3.0.4",
+ "pidtree": "^0.3.0",
+ "read-pkg": "^3.0.0",
+ "shell-quote": "^1.6.1",
+ "string.prototype.padend": "^3.0.0"
+ },
+ "bin": {
+ "npm-run-all": "bin/npm-run-all/index.js",
+ "run-p": "bin/run-p/index.js",
+ "run-s": "bin/run-s/index.js"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "node_modules/npm-run-all/node_modules/cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "dev": true,
+ "dependencies": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ },
+ "engines": {
+ "node": ">=4.8"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
+ "dev": true,
+ "dependencies": {
+ "shebang-regex": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/npm-run-all/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
"node_modules/npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
@@ -12927,6 +13197,18 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/pidtree": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
+ "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
+ "dev": true,
+ "bin": {
+ "pidtree": "bin/pidtree.js"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
"node_modules/pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
@@ -14856,6 +15138,41 @@
"pify": "^2.3.0"
}
},
+ "node_modules/read-pkg": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+ "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==",
+ "dev": true,
+ "dependencies": {
+ "load-json-file": "^4.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/read-pkg/node_modules/path-type": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+ "dev": true,
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/read-pkg/node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
@@ -15832,6 +16149,12 @@
"node": ">=8"
}
},
+ "node_modules/shell-quote": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
+ "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
+ "dev": true
+ },
"node_modules/side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -15917,6 +16240,38 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/spdx-correct": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
+ "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
+ "dev": true,
+ "dependencies": {
+ "spdx-expression-parse": "^3.0.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-exceptions": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
+ "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
+ "dev": true
+ },
+ "node_modules/spdx-expression-parse": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+ "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "dev": true,
+ "dependencies": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-license-ids": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
+ "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==",
+ "dev": true
+ },
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -16023,6 +16378,23 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/string.prototype.padend": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz",
+ "integrity": "sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.19.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/string.prototype.trimend": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz",
@@ -17437,6 +17809,12 @@
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
"integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
},
+ "node_modules/v8-compile-cache-lib": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
+ "dev": true
+ },
"node_modules/v8-to-istanbul": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz",
@@ -17460,6 +17838,16 @@
"node": ">= 8"
}
},
+ "node_modules/validate-npm-package-license": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "dev": true,
+ "dependencies": {
+ "spdx-correct": "^3.0.0",
+ "spdx-expression-parse": "^3.0.0"
+ }
+ },
"node_modules/vfile": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz",
@@ -17984,24 +18372,30 @@
"version": "2.2.0",
"license": "MIT"
},
- "packages/spec": {
- "name": "@supabase/generator",
+ "packages/generator": {
"version": "0.0.0",
"license": "MIT",
+ "dependencies": {
+ "json-stringify-safe": "^5.0.1"
+ },
"devDependencies": {
"@apidevtools/swagger-cli": "^4.0.4",
+ "@types/json-stringify-safe": "^5.0.0",
"@types/lodash": "^4.14.182",
"ejs": "^3.1.8",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
+ "npm-run-all": "^4.1.5",
"openapi-types": "^12.0.0",
+ "prettier": "^2.7.1",
"ts-node": "^10.9.1"
}
},
- "packages/spec/node_modules/acorn": {
+ "packages/generator/node_modules/acorn": {
"version": "8.8.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
"dev": true,
- "license": "MIT",
"bin": {
"acorn": "bin/acorn"
},
@@ -18009,28 +18403,32 @@
"node": ">=0.4.0"
}
},
- "packages/spec/node_modules/acorn-walk": {
+ "packages/generator/node_modules/acorn-walk": {
"version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
+ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
"dev": true,
- "license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
- "packages/spec/node_modules/arg": {
+ "packages/generator/node_modules/arg": {
"version": "4.1.3",
- "dev": true,
- "license": "MIT"
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
+ "dev": true
},
- "packages/spec/node_modules/argparse": {
+ "packages/generator/node_modules/argparse": {
"version": "2.0.1",
- "dev": true,
- "license": "Python-2.0"
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
},
- "packages/spec/node_modules/js-yaml": {
+ "packages/generator/node_modules/js-yaml": {
"version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
- "license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
},
@@ -18038,10 +18436,11 @@
"js-yaml": "bin/js-yaml.js"
}
},
- "packages/spec/node_modules/ts-node": {
+ "packages/generator/node_modules/ts-node": {
"version": "10.9.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz",
+ "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==",
"dev": true,
- "license": "MIT",
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
@@ -18080,6 +18479,21 @@
}
}
},
+ "packages/spec": {
+ "name": "@supabase/generator",
+ "version": "0.0.0",
+ "extraneous": true,
+ "license": "MIT",
+ "devDependencies": {
+ "@apidevtools/swagger-cli": "^4.0.4",
+ "@types/lodash": "^4.14.182",
+ "ejs": "^3.1.8",
+ "js-yaml": "^4.1.0",
+ "lodash": "^4.17.21",
+ "openapi-types": "^12.0.0",
+ "ts-node": "^10.9.1"
+ }
+ },
"packages/tsconfig": {
"version": "0.0.0"
}
@@ -19413,6 +19827,27 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true
},
+ "@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "requires": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "dependencies": {
+ "@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "requires": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ }
+ }
+ },
"@csstools/convert-colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz",
@@ -20559,35 +20994,49 @@
}
},
"@supabase/generator": {
- "version": "file:packages/spec",
+ "version": "file:packages/generator",
"requires": {
"@apidevtools/swagger-cli": "^4.0.4",
+ "@types/json-stringify-safe": "^5.0.0",
"@types/lodash": "^4.14.182",
"ejs": "^3.1.8",
"js-yaml": "^4.1.0",
+ "json-stringify-safe": "^5.0.1",
"lodash": "^4.17.21",
+ "npm-run-all": "^4.1.5",
"openapi-types": "^12.0.0",
+ "prettier": "^2.7.1",
"ts-node": "^10.9.1"
},
"dependencies": {
"acorn": {
"version": "8.8.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
"dev": true
},
"acorn-walk": {
"version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
+ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
"dev": true
},
"arg": {
"version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"argparse": {
"version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"js-yaml": {
"version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"requires": {
"argparse": "^2.0.1"
@@ -20595,6 +21044,8 @@
},
"ts-node": {
"version": "10.9.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz",
+ "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==",
"dev": true,
"requires": {
"@cspotcode/source-map-support": "^0.8.0",
@@ -20711,6 +21162,30 @@
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
"integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw=="
},
+ "@tsconfig/node10": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
+ "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
+ "dev": true
+ },
+ "@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
+ "dev": true
+ },
+ "@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
+ "dev": true
+ },
+ "@tsconfig/node16": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz",
+ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
+ "dev": true
+ },
"@types/babel__core": {
"version": "7.1.19",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz",
@@ -20856,6 +21331,12 @@
"integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
"devOptional": true
},
+ "@types/json-stringify-safe": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@types/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz",
+ "integrity": "sha512-UUA1sH0RSRROdInuDOA1yoRzbi5xVFD1RHCoOvNRPTNwR8zBkJ/84PZ6NhKVDtKp0FTeIccJCdQz1X2aJPr4uw==",
+ "dev": true
+ },
"@types/json5": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
@@ -24510,6 +24991,12 @@
}
}
},
+ "hosted-git-info": {
+ "version": "2.8.9",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
+ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
+ "dev": true
+ },
"html-encoding-sniffer": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
@@ -25689,6 +26176,12 @@
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA=="
},
+ "json-parse-better-errors": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
+ "dev": true
+ },
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@@ -25705,6 +26198,11 @@
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="
},
+ "json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="
+ },
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
@@ -25788,6 +26286,42 @@
"repeat-string": "^1.5.2"
}
},
+ "load-json-file": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+ "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^4.0.0",
+ "pify": "^3.0.0",
+ "strip-bom": "^3.0.0"
+ },
+ "dependencies": {
+ "parse-json": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==",
+ "dev": true,
+ "requires": {
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "dev": true
+ },
+ "strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true
+ }
+ }
+ },
"loader-runner": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
@@ -26167,6 +26701,12 @@
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
},
+ "memorystream": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
+ "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==",
+ "dev": true
+ },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -26678,6 +27218,12 @@
"escalade": "^3.1.1"
}
},
+ "nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
"node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
@@ -26728,6 +27274,26 @@
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.8.tgz",
"integrity": "sha512-2zaTFGqZixVmTxpJRCFC+Vk5eGRd/fYtvIR+dl5u9QXLTQWGIf48x/JXvo58g9sa0bU6To04XUv554Paykum3g=="
},
+ "normalize-package-data": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "^2.1.4",
+ "resolve": "^1.10.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
"normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -26738,6 +27304,98 @@
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
"integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA=="
},
+ "npm-run-all": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
+ "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "chalk": "^2.4.1",
+ "cross-spawn": "^6.0.5",
+ "memorystream": "^0.3.1",
+ "minimatch": "^3.0.4",
+ "pidtree": "^0.3.0",
+ "read-pkg": "^3.0.0",
+ "shell-quote": "^1.6.1",
+ "string.prototype.padend": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "dev": true,
+ "requires": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ },
+ "path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ },
+ "shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^1.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
+ "dev": true
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ }
+ }
+ },
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
@@ -26978,6 +27636,12 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
},
+ "pidtree": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
+ "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
+ "dev": true
+ },
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
@@ -28392,6 +29056,34 @@
"pify": "^2.3.0"
}
},
+ "read-pkg": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+ "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==",
+ "dev": true,
+ "requires": {
+ "load-json-file": "^4.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^3.0.0"
+ },
+ "dependencies": {
+ "path-type": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+ "dev": true,
+ "requires": {
+ "pify": "^3.0.0"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "dev": true
+ }
+ }
+ },
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
@@ -29129,6 +29821,12 @@
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
},
+ "shell-quote": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
+ "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
+ "dev": true
+ },
"side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -29192,6 +29890,38 @@
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
"integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA=="
},
+ "spdx-correct": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
+ "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
+ "dev": true,
+ "requires": {
+ "spdx-expression-parse": "^3.0.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "spdx-exceptions": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
+ "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
+ "dev": true
+ },
+ "spdx-expression-parse": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+ "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "dev": true,
+ "requires": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "spdx-license-ids": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
+ "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==",
+ "dev": true
+ },
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -29283,6 +30013,17 @@
"side-channel": "^1.0.4"
}
},
+ "string.prototype.padend": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz",
+ "integrity": "sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.19.1"
+ }
+ },
"string.prototype.trimend": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz",
@@ -30452,6 +31193,12 @@
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
"integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
},
+ "v8-compile-cache-lib": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
+ "dev": true
+ },
"v8-to-istanbul": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz",
@@ -30471,6 +31218,16 @@
}
}
},
+ "validate-npm-package-license": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "dev": true,
+ "requires": {
+ "spdx-correct": "^3.0.0",
+ "spdx-expression-parse": "^3.0.0"
+ }
+ },
"vfile": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz",
diff --git a/spec/supabase_js_v2_legacy.yml b/spec/supabase_js_v2_legacy.yml
index cfe9d171435..e6208bcb81a 100644
--- a/spec/supabase_js_v2_legacy.yml
+++ b/spec/supabase_js_v2_legacy.yml
@@ -33,7 +33,7 @@ pages:
isSpotlight: true
js: |
```js
- const { user, session, error } = await supabase.auth.signUp({
+ const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
})
@@ -42,282 +42,106 @@ pages:
isSpotlight: true
js: |
```js
- const { user, session, error } = await supabase.auth.signUp(
+ const { data, error } = await supabase.auth.signUp(
{
email: 'example@email.com',
password: 'example-password',
- },
- {
- data: {
- first_name: 'John',
- age: 27,
+ options: {
+ data: {
+ first_name: 'John',
+ age: 27,
+ }
}
}
)
```
- - name: Sign up with third-party providers.
- hideCodeBlock: true
+ auth.signInWithPassword():
+ title: 'signInWithPassword()'
+ $ref: '@supabase/gotrue-js.GoTrueClient.signInWithPassword'
+ notes: |
+ - Requires either an email and password or a phone number and password.
+ example:
+ - name: Sign in with Email.
description: |
- You can sign up with OAuth providers using the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-third-party-providers) method.
- - name: Sign up with Phone.
+ Sign in with email and password. After a user has verified their email, they can use the [`signInWithPassword()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
+ js: |
+ ```js
+ const { data, error } = await supabase.auth.signInWithPassword({
+ email: 'example@email.com',
+ password: 'example-password',
+ })
+ ```
+ - name: Sign in with Phone.
description: |
Supabase supports Phone Auth. After a user has verified their number, they can use the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
js: |
```js
- const { user, session, error } = await supabase.auth.signUp({
+ const { data, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
password: 'some-password',
})
// After receiving an SMS with One Time Password.
- let { session, error } = await supabase.auth.verifyOTP({
+ let { data, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
})
```
-
- auth.signInWithPassword():
- title: 'signInWithPassword()'
- $ref: '@supabase/gotrue-js.GoTrueClient.signInWithPassword'
- notes: |
- - A user can sign up either via email or OAuth.
- - If you provide `email` without a `password`, the user will be sent a magic link.
- - The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
- - Specifying a `provider` will open the browser to the relevant login page.
- examples:
- - name: Sign in with email.
- isSpotlight: true
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
- })
- ```
- - name: Sign in with magic link.
- description: If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com'
- })
- ```
- - name: Sign in using third-party providers.
- description: Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
- provider: 'github'
- })
- ```
- - name: Sign in with Phone.
- description: Supabase supports Phone Auth.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- phone: '+13334445555',
- password: 'some-password',
- })
- ```
- - name: Sign in with redirect.
- description: |
- Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
- the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
- Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
- any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- provider: 'github'
- }, {
- redirectTo: 'https://example.com/welcome'
- })
- ```
- - name: Sign in with scopes.
- description: |
- If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
- You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- provider: 'github'
- }, {
- scopes: 'repo gist notifications'
- })
- const oAuthToken = session.provider_token // use to access provider API
- ```
- - name: Sign in using a refresh token (e.g. in React Native).
- description: |
- If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
- js: |
- ```js
- // An example using Expo's `AuthSession`
- const redirectUri = AuthSession.makeRedirectUri({ useProxy: false });
- const provider = 'google';
-
- AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
- }).then(async (response: any) => {
- if (!response) return;
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- });
- });
- ```
-
auth.signInWithOtp():
title: 'signInWithOtp()'
$ref: '@supabase/gotrue-js.GoTrueClient.signInWithOtp'
notes: |
- - A user can sign up either via email or OAuth.
- - If you provide `email` without a `password`, the user will be sent a magic link.
+ - This method is used for passwordless sign-ins where an otp is sent to the user's email or phone number.
+ - Requires either an email or phone number.
+ - If you're using an email, you can configure whether you want the user to receive a magiclink or an otp.
+ - If you're using phone, you can configure whether you want the user to receive a magiclink or an otp.
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
- - Specifying a `provider` will open the browser to the relevant login page.
examples:
- name: Sign in with email.
isSpotlight: true
+ description: The user will be sent an otp to their email. By default, a given user can only request an otp once every 60 seconds.
js: |
```js
- const { user, session, error } = await supabase.auth.signIn({
+ const { data, error } = await supabase.auth.signInWithOtp({
email: 'example@email.com',
- password: 'example-password',
})
```
- - name: Sign in with magic link.
- description: If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
+ - name: Sign in with sms otp.
+ isSpotlight: true
+ description: The user will be sent an otp to their phone number. By default, a given user can only request an otp once every 60 seconds.
js: |
```js
- const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com'
- })
- ```
- - name: Sign in using third-party providers.
- description: Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
- provider: 'github'
- })
- ```
- - name: Sign in with Phone.
- description: Supabase supports Phone Auth.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
+ const { data, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
- password: 'some-password',
})
```
- - name: Sign in with redirect.
- description: |
- Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
- the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
- Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
- any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- provider: 'github'
- }, {
- redirectTo: 'https://example.com/welcome'
- })
- ```
- - name: Sign in with scopes.
- description: |
- If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
- You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- provider: 'github'
- }, {
- scopes: 'repo gist notifications'
- })
- const oAuthToken = session.provider_token // use to access provider API
- ```
- - name: Sign in using a refresh token (e.g. in React Native).
- description: |
- If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
- js: |
- ```js
- // An example using Expo's `AuthSession`
- const redirectUri = AuthSession.makeRedirectUri({ useProxy: false });
- const provider = 'google';
-
- AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
- }).then(async (response: any) => {
- if (!response) return;
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- });
- });
- ```
-
auth.signInWithOAuth():
title: 'signInWithOAuth()'
$ref: '@supabase/gotrue-js.GoTrueClient.signInWithOAuth'
notes: |
- - A user can sign up either via email or OAuth.
- - If you provide `email` without a `password`, the user will be sent a magic link.
- - The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
- - Specifying a `provider` will open the browser to the relevant login page.
+ - This method is used for signing in using a third-party provider.
+ - Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
examples:
- - name: Sign in with email.
- isSpotlight: true
+ - name: Sign in using a third-party provider.
js: |
```js
- const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com',
- password: 'example-password',
- })
- ```
- - name: Sign in with magic link.
- description: If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- email: 'example@email.com'
- })
- ```
- - name: Sign in using third-party providers.
- description: Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- // provider can be 'github', 'google', 'gitlab', and more
+ const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
})
```
- - name: Sign in with Phone.
- description: Supabase supports Phone Auth.
- js: |
- ```js
- const { user, session, error } = await supabase.auth.signIn({
- phone: '+13334445555',
- password: 'some-password',
- })
- ```
- - name: Sign in with redirect.
+ - name: Sign in using a third-party provider with redirect.
description: |
- Note that the `redirectTo` param is only relevant for OAuth logins, where the login flow is managed by
- the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
-
- Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
+ The `redirectTo` param will only applied on the callback made from the third-party provider. It does not redirect the user immediately after invoking this method.
+ In order for the `redirectTo` param to be allowed, one needs to include it in an allowlist. Supabase supports this for
any URL path on your website (the URL must either be on the same domain as your Site URL [see Auth>Settings in dashboard], or must match one of the Additional Redirect URLs [also in Auth>Settings]).
js: |
```js
- const { user, session, error } = await supabase.auth.signIn({
+ const { user, session, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
- }, {
- redirectTo: 'https://example.com/welcome'
- })
+ options: {
+ redirectTo: 'https://example.com/welcome'
+ }
+ }
```
- name: Sign in with scopes.
description: |
@@ -325,33 +149,14 @@ pages:
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
js: |
```js
- const { user, session, error } = await supabase.auth.signIn({
+ const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
- }, {
- scopes: 'repo gist notifications'
+ options: {
+ scopes: 'repo gist notifications'
+ }
})
- const oAuthToken = session.provider_token // use to access provider API
+ const oAuthToken = data.session.provider_token // use to access provider API
```
- - name: Sign in using a refresh token (e.g. in React Native).
- description: |
- If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
- js: |
- ```js
- // An example using Expo's `AuthSession`
- const redirectUri = AuthSession.makeRedirectUri({ useProxy: false });
- const provider = 'google';
-
- AuthSession.startAsync({
- authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
- returnUrl: redirectUri,
- }).then(async (response: any) => {
- if (!response) return;
- const { user, session, error } = await supabase.auth.signIn({
- refreshToken: response.params?.refresh_token,
- });
- });
- ```
-
auth.signOut():
title: 'signOut()'
$ref: '@supabase/gotrue-js.GoTrueClient.signOut'
@@ -362,7 +167,6 @@ pages:
```js
const { error } = await supabase.auth.signOut()
```
-
auth.getSession():
title: 'getSession()'
$ref: '@supabase/gotrue-js.GoTrueClient.getSession'
@@ -371,22 +175,27 @@ pages:
isSpotlight: true
js: |
```js
- const session = supabase.auth.session()
+ const { data, error } = supabase.auth.getSession()
```
-
auth.getUser():
title: 'getUser()'
$ref: '@supabase/gotrue-js.GoTrueClient.getUser'
notes: |
- This method gets the user object from memory.
+ - This method gets the user object using the current session.
+ - Fetches the user object from the database instead of local storage.
examples:
- - name: Get the logged in user
+ - name: Get the logged in user with the current existing session
isSpotlight: true
js: |
```js
- const user = await supabase.auth.getUser()
+ const user = supabase.auth.getUser()
+ ```
+ - name: Get the logged in user with a custom access token jwt.
+ isSpotlight: true
+ js: |
+ ```js
+ const user = supabase.auth.getUser(jwt)
```
-
auth.updateUser():
title: 'updateUser()'
$ref: '@supabase/gotrue-js.GoTrueClient.updateUser'
@@ -403,13 +212,13 @@ pages:
isSpotlight: true
js: |
```js
- const { user, error } = await supabase.auth.updateUser({email: 'new@email.com'})
+ const { data, error } = await supabase.auth.updateUser({email: 'new@email.com'})
```
- name: Update password for authenticated user.
isSpotlight: true
js: |
```js
- const { user, error } = await supabase.auth.updateUser({password: 'new password'})
+ const { data, error } = await supabase.auth.updateUser({password: 'new password'})
```
- name: Update a user's metadata.
isSpotlight: true
@@ -419,66 +228,18 @@ pages:
data: { hello: 'world' }
})
```
-
auth.setSession():
title: 'setSession()'
$ref: '@supabase/gotrue-js.GoTrueClient.setSession'
examples:
- name: Basic example.
- description: This is most useful on server-side functions where you cannot log the user in, but have access to the user's access token.
+ description: Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
isSpotlight: true
js: |
```js
- function apiFunction(req, res) {
- // Assuming the access token was sent as a header "X-Supabase-Auth"
- const { access_token } = req.get('X-Supabase-Auth')
-
- // You can now use it within a Supabase Client
- const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key")
- const { user, error } = supabase.auth.setAuth(access_token)
-
- // This client will now send requests as this user
- const { data } = await supabase.from('your_table').select()
+ const { data, error } = supabase.auth.setSession(refresh_token)
}
```
- - name: With Express.
- isSpotlight: true
- js: |
- ```js
-
- /**
- * Make a request from the client to your server function
- */
- async function makeApiRequest() {
- const token = newClient.session()?.access_token
-
- await fetch('https://example.com/withAuth', {
- method: 'GET',
- withCredentials: true,
- credentials: 'include',
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': bearer, // Your own auth
- 'X-Supabase-Auth': token, // Set the Supabase user
- }
- })
- }
-
- /**
- * Use the Auth token in your server-side function.
- */
- async function apiFunction(req, res) {
- const { access_token } = req.get('X-Supabase-Auth')
-
- // You can now use it within a Supabase Client
- const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key")
- const { user, error } = supabase.auth.setAuth(access_token)
-
- // This client will now send requests as this user
- const { data } = await supabase.from('your_table').select()
- }
- ```
-
auth.onAuthStateChange():
title: 'onAuthStateChange()'
$ref: '@supabase/gotrue-js.GoTrueClient.onAuthStateChange'
@@ -533,7 +294,7 @@ pages:
if (event == 'PASSWORD_RECOVERY') console.log('PASSWORD_RECOVERY', session)
})
```
- auth.api.getUserById():
+ auth.admin.getUserById():
title: 'getUserById()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.getUserById'
notes: |
@@ -545,10 +306,10 @@ pages:
isSpotlight: true
js: |
```js
- const { user, error } = await supabase.auth.api.getUserById(1)
+ const { user, error } = await supabase.auth.admin.getUserById(1)
```
- auth.api.listUsers():
+ auth.admin.listUsers():
title: 'listUsers()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.listUsers'
notes: |
@@ -559,10 +320,9 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.listUsers()
+ const { data: user, error } = await supabase.auth.admin.listUsers()
```
-
- auth.api.createUser():
+ auth.admin.createUser():
title: 'createUser()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.createUser'
notes: |
@@ -574,7 +334,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.createUser({
+ const { data, error } = await supabase.auth.admin.createUser({
email: 'user@email.com',
password: 'password',
user_metadata: { name: 'Yoda' }
@@ -584,7 +344,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.createUser({
+ const { data, error } = await supabase.auth.admin.createUser({
email: 'user@email.com',
email_confirm: true
})
@@ -593,13 +353,12 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.createUser({
+ const { data, error } = await supabase.auth.admin.createUser({
phone: '1234567890',
phone_confirm: true
})
```
-
- auth.api.deleteUser():
+ auth.admin.deleteUser():
title: 'deleteUser()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.deleteUser'
notes: |
@@ -610,12 +369,12 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.deleteUser(
+ const { data, error } = await supabase.auth.admin.deleteUser(
'715ed5db-f090-4b8c-a067-640ecee36aa0'
)
```
- auth.api.inviteUserByEmail():
+ auth.admin.inviteUserByEmail():
title: 'inviteUserByEmail()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.inviteUserByEmail'
notes: |
@@ -626,34 +385,16 @@ pages:
isSpotlight: false
js: |
```js
- const { data: user, error } = await supabase.auth
- .api
- .inviteUserByEmail('email@example.com')
+ const { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')
```
- # auth.api.sendMobileOTP():
- # title: 'sendMobileOTP()'
- # $ref: '@supabase/gotrue-js.GoTrueAdminApi.sendMobileOTP'
- # 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:
- # - name: Basic example.
- # isSpotlight: false
- # js: |
- # ```js
- # const { data: user, error } = await supabase.auth
- # .api
- # .sendMobileOTP('12345879')
- # ```
-
- auth.api.resetPasswordForEmail():
+ auth.resetPasswordForEmail():
title: 'resetPasswordForEmail()'
$ref: '@supabase/gotrue-js.GoTrueClient.resetPasswordForEmail'
notes: |
Sends a reset request to an email address.
- When the user clicks the reset link in the email they will be forwarded to:
+ When the user clicks the reset link in the email they will be forwarded to the site url or the redirect url specified:
`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
@@ -662,36 +403,48 @@ pages:
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 })
+ const { error, data } = await supabase.auth.updateUser({ password : new_password })
```
examples:
- name: Reset password
isSpotlight: true
js: |
```js
- const { data, error } = await supabase.auth.api
- .resetPasswordForEmail('user@email.com')
+ const { error, data } = await supabase.auth.resetPasswordForEmail(email, options: {
+ redirectTo: 'https://example.com/update-password',
+ })
```
- auth.api.generateLink():
+ auth.admin.generateLink():
title: 'generateLink()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.generateLink'
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:
- - name: Generate invite link.
- isSpotlight: false
+ - name: Generate a signup link.
+ isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.generateLink(
- 'invite',
+ const { data, error } = await supabase.auth.admin.generateLink(
'email@example.com'
+ 'signup',
+ {
+ 'password': 'secret'
+ }
+ )
+ ```
+ - name: Generate an invite link.
+ isSpotlight: true
+ js: |
+ ```js
+ const { data, error } = await supabase.auth.admin.generateLink(
+ 'email@example.com'
+ 'invite',
)
```
- auth.api.updateUserById():
+ auth.admin.updateUserById():
title: 'updateUserById()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.updateUserById'
notes: |
@@ -702,7 +455,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ email: 'new@email.com' }
)
@@ -711,7 +464,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ password: 'new_password' }
)
@@ -720,7 +473,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ user_metadata: { hello: 'world' } }
)
@@ -729,7 +482,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ app_metadata: { plan: 'trial' } }
)
@@ -738,7 +491,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ email_confirm: true }
)
@@ -747,7 +500,7 @@ pages:
isSpotlight: true
js: |
```js
- const { data: user, error } = await supabase.auth.api.updateUserById(
+ const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ phone_confirm: true }
)