Skip to main content
Version: v2 RC

signInWithPassword()

Log in an existing user with an email and password or phone and password.

const { data, error } = await supabase.auth.signInWithPassword({
email: 'example@email.com',
password: 'example-password',
})

Parameters

  • SignInWithPasswordCredentialsrequiredreflection | reflection

    No description provided.

      Properties
    • objectrequiredobject

      No description provided.

        Properties
      • phonerequiredstring

        The user's phone number.

      • passwordrequiredstring

        The user's password.

      • optionsoptionalobject

        No description provided.

          Properties
        • captchaTokenoptionalstring

          Verification token received when the user completes the captcha on the site.

    • objectrequiredobject

      No description provided.

        Properties
      • passwordrequiredstring

        The user's password.

      • emailrequiredstring

        The user's email address.

      • optionsoptionalobject

        No description provided.

          Properties
        • captchaTokenoptionalstring

          Verification token received when the user completes the captcha on the site.

Notes

  • Requires either an email and password or a phone number and password.

Examples

Sign in with email and password

const { data, error } = await supabase.auth.signInWithPassword({
email: 'example@email.com',
password: 'example-password',
})

Sign in with phone and password

const { data, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
password: 'some-password',
})

// After receiving a SMS with a OTP.
const { data, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
})