© 2026 Hedgehog Software, LLC
javascript v2.0
data.session
supabase.auth.getSession()
null
"@supabase/supabase-js": "^2.2.1"
const options = { auth: { autoRefreshToken: true, persistSession: true } } const supabase = createClient(env.SB_URL, env.SB_ANON_KEY, options) const login = async () => { const { data, error } = await supabase.auth.getSession() if (error) { console.error(error) return false } if (data.session == null) { console.log("here") const { data, error } = await supabase.auth.signInWithPassword({ email: env.USER, password: env.PASS, }) if (error) { console.error(error) return false } //I've printed data here, All seems fine. } //debugging here my session: console.log(await supabase.auth.getSession()) return true }
supabase.getUser()