diff --git a/apps/temp-docs/_supabase_js/release-notes.md b/apps/temp-docs/_supabase_js/release-notes.md
index d77cf283abc..715215f2197 100644
--- a/apps/temp-docs/_supabase_js/release-notes.md
+++ b/apps/temp-docs/_supabase_js/release-notes.md
@@ -82,9 +82,7 @@ Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last.
Storage key name in the Auth library has changed to include project reference which means that existing websites that had their JWT expiry set to a longer time could find their users logged out with this upgrade.
```jsx
-const defaultStorageKey = `sb-${
- new URL(this.authUrl).hostname.split('.')[0]
-}-auth-token`
+const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`
```
### New Auth Types
diff --git a/apps/temp-docs/_supabase_js/upgrade-guide.mdx b/apps/temp-docs/_supabase_js/upgrade-guide.mdx
index c66a896e9ba..c3a148c534c 100644
--- a/apps/temp-docs/_supabase_js/upgrade-guide.mdx
+++ b/apps/temp-docs/_supabase_js/upgrade-guide.mdx
@@ -13,12 +13,11 @@ No new features will be added to supabase-js v1 , but we'll continuing merging s
## Upgrade the client library
-
```sh
npm install @supabase/supabase-js@2
```
-*Optionally* if you are using custom configuration with `createClient` then follow below:
+_Optionally_ if you are using custom configuration with `createClient` then follow below:
@@ -42,13 +42,14 @@ const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
```ts title="src/supabaseClient.ts"
const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
db: {
- schema: 'custom'
+ schema: 'custom',
},
auth: {
- persistSession: true
- }
+ persistSession: true,
+ },
})
```
+
@@ -59,6 +60,7 @@ Read more about the [constructor options](/docs/reference/javascript/release-not
The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).
#### Sign in with email and password
+
```ts
-const { data: { user }, error } = await supabase.auth.signInWithPassword({ email, password })
+const {
+ data: { user },
+ error,
+} = await supabase.auth.signInWithPassword({ email, password })
```
+
#### Sign in with magic link
+
@@ -101,10 +110,12 @@ const { error } = await supabase.auth.signIn({ email })
```ts
const { error } = await supabase.auth.signInWithOtp({ email })
```
+
#### Sign in with a third-party provider
+
@@ -124,10 +136,12 @@ const { error } = await supabase.auth.signIn({ provider })
```ts
const { error } = await supabase.auth.signInWithOAuth({ provider })
```
+
#### Sign in with phone
+
@@ -147,10 +162,12 @@ const { error } = await supabase.auth.signIn({ phone, password })
```ts
const { error } = await supabase.auth.signInWithPassword({ phone, password })
```
+
#### Sign in with phone using OTP
+
@@ -173,10 +191,12 @@ const { data, error } = await supabase.auth.signInWithOtp({ phone })
// After receiving a SMS with a OTP.
const { data, error } = await supabase.auth.verifyOtp({ phone, token })
```
+
#### Reset password for email
+
@@ -196,10 +217,12 @@ const { data, error } = await supabase.auth.api.resetPasswordForEmail(email)
```ts
const { data, error } = await supabase.auth.resetPasswordForEmail(email)
```
+
#### Get the user's current session
+
```ts
-const { data: { session } } = await supabase.auth.getSession()
+const {
+ data: { session },
+} = await supabase.auth.getSession()
```
+
#### Get the logged-in user
+
```ts
-const { data: { session } } = await supabase.auth.getSession()
+const {
+ data: { session },
+} = await supabase.auth.getSession()
const { user } = session
```
+
#### Update user data for a logged-in user
+
```ts
-const { data: { user }, error } = await supabase.auth.updateUser({ attributes })
+const {
+ data: { user },
+ error,
+} = await supabase.auth.updateUser({ attributes })
```
+
@@ -283,19 +321,21 @@ const { data: { user }, error } = await supabase.auth.updateUser({ attributes })
```ts
const { user, error } = supabase.auth.setAuth(access_token)
```
+
```ts
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
- global: {
+ global: {
headers: {
- Authorization: `Bearer ${access_token}`
- }
- }
+ Authorization: `Bearer ${access_token}`,
+ },
+ },
})
```
+
@@ -319,6 +359,7 @@ Previously, these methods return inserted/updated/deleted rows by default (which
```ts
const { data, error } = await supabase.auth.insert({ new_data })
```
+
@@ -326,6 +367,7 @@ const { data, error } = await supabase.auth.insert({ new_data })
```ts
const { data, error } = await supabase.auth.insert({ new_data }).select()
```
+
@@ -343,6 +385,7 @@ const { data, error } = await supabase.auth.insert({ new_data }).select()
```ts
const { data, error } = await supabase.auth.update({ new_data }).eq('id', id)
```
+
@@ -350,6 +393,7 @@ const { data, error } = await supabase.auth.update({ new_data }).eq('id', id)
```ts
const { data, error } = await supabase.auth.update({ new_data }).eq('id', id).select()
```
+
@@ -367,12 +411,12 @@ const { data, error } = await supabase.auth.update({ new_data }).eq('id', id).se
```ts
-const userListener = supabase.from('users')
- .on('*',
- (payload) => handleAllEventsPayload(payload.new)
- )
+const userListener = supabase
+ .from('users')
+ .on('*', (payload) => handleAllEventsPayload(payload.new))
.subscribe()
```
+
@@ -386,6 +430,7 @@ const userListener = supabase.channel('public:user')
)
.subscribe()
```
+
@@ -403,6 +448,7 @@ const userListener = supabase.channel('public:user')
```ts
userListener.unsubscribe()
```
+
@@ -410,5 +456,6 @@ userListener.unsubscribe()
```ts
supabase.removeChannel('public:users')
```
+
-
\ No newline at end of file
+
diff --git a/apps/temp-docs/_supabase_js/working-with-types.md b/apps/temp-docs/_supabase_js/working-with-types.md
index 519650ed995..cb564843bba 100644
--- a/apps/temp-docs/_supabase_js/working-with-types.md
+++ b/apps/temp-docs/_supabase_js/working-with-types.md
@@ -43,10 +43,7 @@ You can enrich the supabase client with the types you generated with Supabase.
import { createClient } from '@supabase/supabase-js'
import { Database } from 'lib/database.types'
-const supabase = createClient(
- process.env.SUPABASE_URL,
- process.env.SUPABASE_ANON_KEY
-)
+const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)
```
## Type hints