Login With Email

Overview#

Setting up Email logins for your Supabase application.

Configure email settings#

  1. For Site URL, enter the final (hosted) URL of your app.
  2. For Auth Providers, enable email provider.

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.

Add login code to your client app#

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

1async function signInWithEmail() {
2  const { data, error } = await supabase.auth.signInWithPassword({
3    email: 'example@email.com',
4    password: 'example-password',
5  })
6}

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

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

Resources#