Auth

Login With Email

Set up Email Logins for your Supabase application.

  • Enable the email provider in your Supabase Project
  • Configure the Site URL and any additional redirect URLs in the authentication management tab.
  • The Site URL represents the default URL that the user will be redirected to after clicking on the email signup confirmation link.

Self hosting

For self-hosting, you can update your project configuration using the files and environment variables provided.

See the self-hosting docs for details.

Sign up the user#

To sign up the user, call signUp() with their email address and password:

async function signUpNewUser() {
const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
options: {
redirectTo: 'https//example.com/welcome'
}
})
}

When your user signs out, call signOut() to remove them from the browser session and any objects from localStorage:

async function signOut() {
const { error } = await supabase.auth.signOut()
}

Sign in the user#

When your user signs in, call signInWithPassword() with their email address and password:

async function signInWithEmail() {
const { data, error } = await supabase.auth.signInWithPassword({
email: 'example@email.com',
password: 'example-password',
options: {
emailRedirectTo: 'https//example.com/welcome'
}
})
}

Sign out the user#

When your user signs out, call signOut() to remove them from the browser session and any objects from localStorage:

async function signOut() {
const { error } = await supabase.auth.signOut()
}

Resources#


We only collect analytics essential to ensuring smooth operation of our services.

Learn more