handleEmailSignUp
newCreate 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
| Param | Type | Description |
|---|---|---|
email* | string | The user's email address. |
password* | string | The user's password. Must be at least 6 characters. |
options.displayName | string | Display name to set on the new user profile. |
options.photoURL | string | Photo 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.