Register users with email and password
New account creation
Better Auth · Module
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.
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.
authClient.signUp.email({ name, email, password, image?, callbackURL? })| Name | Type | Description |
|---|---|---|
name | string | User's display name; required. |
email | string | User's email address; required. |
password | string | Account password; required. |
image | string | Optional profile image URL. |
callbackURL | string | Optional post-signup redirect URL. |
The client call returns an object containing data and error fields.
emailAndPassword.enabled before using email-and-password signup.authClient.signUp.email.callbackURL can specify where to redirect after signup.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.
New account creation
Onboarding flow
Profile setup
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.
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.
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.enabledauth.api.signUpEmailPOST /sign-up/emailemailVerification