An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
MIT License
Published by kiwicopple almost 4 years ago
supabase.auth
to gotrue-js - supports Oath logins & moresupabaseKey
is passed in it throws an errorsupabase.auth.logout()
throws "Invalid user" error.body
is now data
Previously:
const { body } = supabase.from('todos').select('*')
Now:
const { data } = supabase.from('todos').select('*')
Errors are returned not thrown
Previously:
try {
const { body } = supabase.from('todos').select('*')
} catch (error) {
console.log(error)
}
Now:
const { data, error } = supabase.from('todos').select('*')
if (error) console.log(error)
ova()
and ovr()
are now just ov()
Previously:
try {
const { body } = supabase.from('todos').select('*').ovr('population_range_millions', [150, 250])
} catch (error) {
console.log(error)
}
Now:
const { data, error } = supabase
.from('todos')
.select('*')
.ov('population_range_millions', [150, 250])
if (error) console.log(error)
offset()
is removed
You can now use range() instead of limit()
+ offset()
ova()
and ovr()
are now just ov()
Previously:
let countries = await supabase.from('cities').select('name').offset(10).limit(10)
Now:
let countries = await supabase.from('cities').select('name').range(10, 20)
signup()
is now signUp()
and email
/ password
is passed as an object
Previously:
const {
body: { user },
} = await supabase.auth.signup('[email protected]', 'password')
Now:
const { user, error } = await supabase.auth.signUp({
email: '[email protected]',
password: 'password',
})
login()
is now signIn()
and email
/ password
is passed as an object
Previously:
const {
body: { user },
} = await supabase.auth.signup('[email protected]', 'password')
Now:
const { user, error } = await supabase.auth.signIn({
email: '[email protected]',
password: 'password',
})
logout()
is now signOut()
Previously:
await supabase.auth.logout()
Now:
await supabase.auth.signOut()
Published by awalias about 4 years ago
Fixes:
Published by awalias about 4 years ago
Published by awalias about 4 years ago
supabase.auth
namespace added which includes:
supabase.auth.signup(email, password)
supabase.auth.login(email, password)
supabase.auth.logout()
supabase.auth.refreshToken()
supabase.auth.user()
Error: {“message”:“Server lacks JWT secret”}
you will need to use version v0.34.0
or lowerPublished by dragarcia over 4 years ago
supabase/postgrest-js
dependency to 0.16.1
.supabse/realtime-js
dependency to 0.9.0
.supabase/supabase-js