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

Better Auth · Module

signIn.email

signIn.email authenticates a user through Better Auth’s client using a required email and password. Optional rememberMe and callbackURL fields control session persistence and the post-sign-in redirect.

How it works

The client method sends the user's email and password to the sign-in endpoint. It can also control whether the session survives browser closure and specify an optional post-login redirect; the call exposes data and error results for handling.

Syntax

authClient.signIn.email({ email, password, rememberMe?, callbackURL? })

Parameters

NameTypeDescription
emailstringThe user's email address.
passwordstringThe user's password; at least 8 and at most 128 characters by default.
rememberMeboolean, optionalWhether to remember the session after the browser closes; defaults to true.
callbackURLstring, optionalURL to redirect to after sign-in.

Returns

An object containing data and error from the client sign-in operation.

Key points

  • Use the client’s signIn.email method for email-and-password authentication.
  • The operation is backed by the POST /sign-in/email endpoint.
  • email is required and contains the address used for authentication.
  • password is required and supplies the user’s credential.
  • callbackURL optionally selects where to redirect after successful sign-in.

Common mistakes

  • The password has a default length range of 8 through 128 characters.
  • Setting rememberMe to false makes the session end when the browser closes.

Example: Sign in with email and password

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

const authClient = createAuthClient({
  baseURL: "http://localhost:3000"
});

const { data, error } = await authClient.signIn.email({
  email: "john.doe@example.com",
  password: "password1234",
  rememberMe: true,
  callbackURL: "/dashboard"
});

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

Creates a Better Auth client and signs in with an email, password, session persistence preference, and optional redirect path.

When to use it

Standard password login

A login form submits a user's email and password to create an authenticated session.

Redirect after login

A login flow should return the user to a specific page after authentication.

Non-persistent session

A shared or temporary browser should not retain the session after closure.

Interview questions

QHow do you sign in a user with email and password?

Call the client method with the required email and password fields: authClient.signIn.email({ email, password }). The result provides data and error values for handling the outcome.

Follow-up: How can the post-login destination be controlled? Add the optional callbackURL field to the request, such as callbackURL: "/dashboard".

QWhat does rememberMe do?

rememberMe controls session persistence after the browser closes. It defaults to true, while false signs the user out when the browser is closed.

Follow-up: What other optional request field is available? callbackURL specifies a URL to redirect to after sign-in.

QWhich endpoint does signIn.email use, and what does it accept?

The client method corresponds to the POST /sign-in/email endpoint. The request requires the user's email address and password, with optional rememberMe and callbackURL settings.

Follow-up: What should be checked when validating passwords? The documented default is at least 8 and at most 128 characters.

  • signUp.email
  • auth.api.signInEmail
  • signIn.emailOtp
  • callbackURL
  • rememberMe

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