BETTER-AUTH. UI
Mutations

useSignInPhoneNumber

Sign in with a phone number and password.

import {
  type PhoneNumberAuthClient,
  useAuth,
  useSignInPhoneNumber
} from "@better-auth-ui/react"

const { authClient } = useAuth()
const { mutate: signInPhoneNumber } = useSignInPhoneNumber(
  authClient as PhoneNumberAuthClient
)

signInPhoneNumber({
  phoneNumber: "+12025550123",
  password,
  rememberMe: true
})

With Better Auth requireVerification, an unverified credential returns PHONE_NUMBER_NOT_VERIFIED and starts phone verification. This password-based method follows configured 2FA.

Params

Prop

Type

Last updated on

On this page