auth.user()

Inside a browser context, user() will return the user data, if there is a logged in user.

For server-side management, you can get a user through auth.api.getUserByCookie()

const user = supabase.auth.user()

Examples

Get the logged in user

const user = supabase.auth.user()