signIn

Log in an existing user, or login via a third-party provider.

// with email and password
const { user, error } = await auth.signIn({
email: 'example@email.com',
password: 'example-password',
})
// send magic link (passwordless link)
const { user, error } = await auth.signIn({
email: 'example@email.com',
})

Parameters

  • credentialsrequiredobject

    The user login details.

      Properties
    • emailoptional|

      The user's email address.

    • passwordoptional|

      The user's password.

    • provideroptionalProvider

      One of the providers supported by GoTrue.

Examples

Sign in

// with email and password
const { user, error } = await auth.signIn({
email: 'example@email.com',
password: 'example-password',
})
// send magic link (passwordless link)
const { user, error } = await auth.signIn({
email: 'example@email.com',
})