Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Better Auth · Module

signUp.email

Creates a Better Auth account using a required name, email, and password, with optional profile image and post-signup callback URL. Email-and-password authentication must be enabled first.

How it works

Call the client’s signUp.email method with the required name, email, and password. You may also provide a profile image and a callback URL for post-signup redirection; the email-and-password feature must be enabled in the auth configuration.

Syntax

authClient.signUp.email({ name, email, password, image?, callbackURL? })

Parameters

NameTypeDescription
namestringUser's display name; required.
emailstringUser's email address; required.
passwordstringAccount password; required.
imagestringOptional profile image URL.
callbackURLstringOptional post-signup redirect URL.

Returns

The client call returns an object containing data and error fields.

Key points

  • Turn on emailAndPassword.enabled before using email-and-password signup.
  • The primary client entry point is authClient.signUp.email.
  • The signup payload requires the user’s name.
  • The payload requires an email address.
  • The payload requires a password.
  • callbackURL can specify where to redirect after signup.

Common mistakes

  • Passwords default to a minimum length of 8 characters and a maximum length of 128.
  • If using the server-side counterpart, ensure its cookies are forwarded to the client.

Example: Sign up with email and password

import { createAuthClient } from "better-auth/client";

const authClient = createAuthClient();

const { data, error } = await authClient.signUp.email({
  name: "John Doe",
  email: "john.doe@example.com",
  password: "password1234",
  image: "https://example.com/image.png",
  callbackURL: "/welcome",
});

if (error) console.error(error);
else console.log(data);

Creates a user through the client-side email-and-password signup method and reports either the returned error or signup data.

When to use it

Register users with email and password

New account creation

Redirect newly registered users to a callback URL

Onboarding flow

Attach an optional profile image during registration

Profile setup

Interview questions

QHow do you create an account with email and password?

Use authClient.signUp.email with name, email, and password. image and callbackURL are optional additions.

Follow-up: What must be configured before calling it? Enable emailAndPassword in the auth configuration.

QWhich fields are required, and what password constraint applies?

The documented client payload requires the user’s name, email address, and password. The password is constrained to 8–128 characters by default.

Follow-up: Can the password policy differ? The page only establishes the default limits; inspect the configuration options before relying on them.

QHow does the client method relate to the server endpoint?

The client method is signUp.email; the corresponding server API method is auth.api.signUpEmail at POST /sign-up/email. Server usage requires cookies to be returned to the client.

Follow-up: Why might a server call appear not to authenticate the browser? Missing cookie forwarding prevents the client from receiving the session cookies.

  • emailAndPassword.enabled
  • auth.api.signUpEmail
  • POST /sign-up/email
  • emailVerification

Source: Email & Password. Checked 2026-10-15.