BETTER-AUTH. UI
Mutations

requestEmailChangeOtpOptions

Start an email change with a code.

Requires the Better Auth email-OTP plugin. If TypeScript cannot infer the plugin methods from your client, type or cast authClient as EmailOtpAuthClient from @better-auth-ui/solid.

Sends a code to the new address. When the server runs with changeEmail: { verifyCurrentEmail: true }, pass the otp the user received at their current address too.

Options factory

import { requestEmailChangeOtpOptions } from "@better-auth-ui/solid"
import { createMutation } from "@tanstack/solid-query"

const requestChange = createMutation(() => requestEmailChangeOtpOptions(authClient))

requestChange.mutate({ newEmail: "[email protected]" })

Params

Prop

Type

Last updated on

On this page