Use nhost.auth.signUp
to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the signIn
function instead.
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
Parameters
params required SignUpParams
requestOptions optional RequestOptions
Examples
Sign up with an email and password
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
Sign up with an email and password and custom headers
nhost.auth.signUp(
{
email: 'joe@example.com',
password: 'secret-password'
},
{
headers: {
'x-cf-turnstile-response': turnstileResponse
}
}
)
Sign up with a security key
nhost.auth.signUp({
email: 'joe@example.com',
securityKey: true
})
@docs https://docs.nhost.io/reference/javascript/auth/sign-up