RefirebaseRefirebase

handleEmailSignUp

new

Create a new user account with email and password.

Basic usage

auth.handleEmailSignUp
const { data, error } = await auth.handleEmailSignUp(
  'alice@example.com',
  'password123',
);

if (error) {
  console.error(error.code, error.message);
} else {
  console.log('Signed up:', data.user.uid);
}

With profile options

Optionally set the display name and photo URL immediately after account creation.

with profile
// Set display name and photo right after account creation
const { data, error } = await auth.handleEmailSignUp(
  'alice@example.com',
  'password123',
  {
    displayName: 'Alice',
    photoURL: 'https://cdn.example.com/avatar.jpg',
  },
);

Parameters

ParamTypeDescription
email*stringThe user's email address.
password*stringThe user's password. Must be at least 6 characters.
options.displayNamestringDisplay name to set on the new user profile.
options.photoURLstringPhoto URL to set on the new user profile.

Return value

Returns

Promise<{ data: UserCredential | null; error?: RefirebaseError }>

data contains the Firebase UserCredential on success. error is a typed RefirebaseError on failure.