Skip to main content

signIn()

Use nhost.auth.signIn to sign in a user using email and password, passwordless (email or sms) or an external provider. signIn can be used to sign in a user in various ways depending on the parameters.

nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})

Parameters


params required SignInParams


Examples

Sign in a user using email and password

nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})

Sign in a user using an OAuth provider (e.g: Google or Facebook)

nhost.auth.signIn({ provider: 'google' })
nhost.auth.signIn({ email: 'joe@example.com' })

Sign in a user using passwordless SMS

// [step 1/2] Passwordless sign in using SMS
nhost.auth.signIn({ phoneNumber: '+11233213123' })

// [step 2/2] Finish passwordless sign in using SMS (OTP)
nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })