Prepare for the PgBouncer and IPv4 deprecations on 26th January 2024

Javascript Reference v2.0

Create a user

Creates a new user. This function should only be called on a server. Never expose your service_role key in the browser.

  • To confirm the user's email address or phone number, set email_confirm or phone_confirm to true. Both arguments default to false.
  • createUser() will not send a confirmation email to the user. You can use inviteUserByEmail() if you want to send them an email invite instead.
  • If you are sure that the created user's email or phone number is legitimate and verified, you can set the email_confirm or phone_confirm param to true.
Parameters
    attributes
    REQUIRED
    AdminUserAttributes

const { data, error } = await supabase.auth.admin.createUser({
  email: 'user@email.com',
  password: 'password',
  user_metadata: { name: 'Yoda' }
})