Skip to main content
Version: v2 RC

getSession()

Returns the session, refreshing it if necessary. The session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.

const { data, error } = await supabase.auth.getSession()

Examples

Get the session data

const { data, error } = await supabase.auth.getSession()