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
Section titled “Parameters”params optional SignInParams
Examples
Section titled “Examples”Sign in a user using email and password
Section titled “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)
Section titled “Sign in a user using an OAuth provider (e.g: Google or Facebook)”nhost.auth.signIn({ provider: 'google' })Sign in a user using passwordless email (Magic Link)
Section titled “Sign in a user using passwordless email (Magic Link)”nhost.auth.signIn({ email: 'joe@example.com' })Sign in a user using passwordless SMS
Section titled “Sign in a user using passwordless SMS”// [step 1/2] Passwordless sign in using SMSnhost.auth.signIn({ phoneNumber: '+11233213123' })
// [step 2/2] Finish passwordless sign in using SMS (OTP)nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })Sign in anonymously
Section titled “Sign in anonymously”// Sign in anonymouslynhost.auth.signIn()
// Later in the application, the user can complete their registrationnhost.auth.signUp({ email: 'joe@example.com', password: 'secret-password'})Sign in with a security key
Section titled “Sign in with a security key”nhost.auth.signIn({ email: 'joe@example.com', securityKey: true})
@docs https://docs.nhost.io/reference/deprecated/javascript/auth/sign-in