BETTER-AUTH. UI
Mutations

changeEmailOtpOptions

Confirm 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.

The address on the session changes, so the session query is refetched on success.

Options factory

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

const changeEmail = createMutation(() => changeEmailOtpOptions(authClient))

changeEmail.mutate({ newEmail: "[email protected]", otp: "123456" })

Params

Prop

Type

Last updated on

On this page