JavaScript: Create a new user

Examples

Sign up.

const { user, session, error } = await supabase.auth.signUp({
  email: 'example@email.com',
  password: 'example-password',
})

Sign up with additional user meta data.

const { user, session, error } = await supabase.auth.signUp(
  {
    email: 'example@email.com',
    password: 'example-password',
  },
  {
    data: {
      first_name: 'John',
      age: 27,
    }
  }
)

Sign up with third-party providers.

Sign up with Phone.

const { user, session, error } = await supabase.auth.signUp({
  phone: '+13334445555',
  password: 'some-password',
})

// After receiving an SMS with One Time Password.
let { session, error } = await supabase.auth.verifyOTP({
  phone: '+13334445555',
  token: '123456',
})