Create a new user
Creates a new user.
- By default, the user needs to verify their email address before logging in. To turn this off, disable Confirm email in your project.
- Confirm email determines if users need to confirm their email address after signing up.
- If Confirm email is enabled, a
user
is returned butsession
is null. - If Confirm email is disabled, both a
user
and asession
are returned.
- If Confirm email is enabled, a
- When the user confirms their email address, they are redirected to the
SITE_URL
by default. You can modify yourSITE_URL
or add additional redirect URLs in your project. - If signUp() is called for an existing confirmed user:
- When both Confirm email and Confirm phone (even when phone provider is disabled) are enabled in your project, an obfuscated/fake user object is returned.
- When either Confirm email or Confirm phone (even when phone provider is disabled) is disabled, the error message,
User already registered
is returned.
- To fetch the currently logged-in user, refer to
getUser()
.
Parameters
credentials
REQUIRED
SignUpWithPasswordCredentialsemail
Optional
stringOne of `email` or `phone` must be provided.
phone
Optional
stringOne of `email` or `phone` must be provided.
password
REQUIRED
stringoptions
Optional
objectemailRedirectTo
Optional
stringOnly for email signups. The redirect URL embedded in the email link. Must be a configured redirect URL for your Supabase instance.
data
Optional
objectA custom data object to store additional user metadata.
captchaToken
Optional
stringchannel
Optional
sms | whatsappThe channel to use for sending messages. Only for phone signups.
const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
})