Mutations
useSendPhoneNumberOtp
Send a phone verification code.
Requires Better Auth phoneNumber() on the server and phoneNumberClient() on the client.
import {
type PhoneNumberAuthClient,
useAuth,
useSendPhoneNumberOtp
} from "@better-auth-ui/react"
const { authClient } = useAuth()
const { mutate: sendOtp } = useSendPhoneNumberOtp(
authClient as PhoneNumberAuthClient
)
sendOtp({ phoneNumber: "+12025550123" })Use sendPhoneNumberOtpOptions(authClient) with useMutation when you need the options factory directly.
Params
Prop
Type
Last updated on