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

Better Auth · Module

signIn.phoneNumber

signIn.phoneNumber authenticates an existing Better Auth user with a phone number and password. It accepts rememberMe to control session persistence.

How it works

With the phone-number plugin enabled, this client method authenticates an existing user by matching the supplied phone number and password. The rememberMe flag controls whether the resulting session is remembered.

Syntax

authClient.signIn.phoneNumber({ phoneNumber, password, rememberMe })

Parameters

NameTypeDescription
phoneNumberstringPhone number used to identify the user.
passwordstringPassword used for authentication.
rememberMebooleanWhether to remember the resulting session; required by the documented example.

Returns

The client call yields an object containing data and error, as shown in the documentation example.

Key points

  • Enable the Phone Number plugin before using this sign-in method.
  • The plugin supports phone-number identity for both registration and authentication.
  • This method uses a phone number together with a password instead of an OTP-only request.
  • Client calls follow Better Auth's standard asynchronous data/error result pattern.
  • Use this flow for users who already have password credentials associated with their phone identity.

Common mistakes

  • Password sign-in requires the user's account record to use the credential provider identifier.

Example: Phone-number sign-in

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

const authClient = createAuthClient();

const { data, error } = await authClient.signIn.phoneNumber({
  phoneNumber: "+1234567890",
  password: "correct-horse-battery-staple",
  rememberMe: true,
});

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

Signs in an existing user with a phone number and password while requesting a remembered session.

When to use it

Password-based phone login

A mobile or web login form collects a user's phone number and password.

Remembered sessions

An application wants a persistent session after successful authentication.

Server-side authentication

A backend needs to perform the same credential flow without the client helper.

Interview questions

QWhat does signIn.phoneNumber do?

The method is authClient.signIn.phoneNumber and it accepts a phone number, password, and rememberMe. It returns the same data-and-error style shown for Better Auth client calls.

Follow-up: How would you support server-side usage? Call auth.api.signInPhoneNumber with the same values inside its body.

QWhich plugin enables this method?

It signs in using phone number as the user identifier rather than an email address. The phone-number plugin provides this capability.

Follow-up: What additional authentication flow does the plugin support? It can also send an OTP for phone verification.

QWhat is the server-side equivalent?

The corresponding server API is auth.api.signInPhoneNumber. Its request places phoneNumber, password, and rememberMe under body.

Follow-up: What must exist before password authentication succeeds? A matching credential account record must be present for the user.

  • phoneNumber
  • auth.api.signInPhoneNumber
  • phoneNumber.sendOtp
  • phoneNumber.verify
  • signUpOnVerification

Source: Phone Number. Checked 2026-10-15.