Alchemy Logo

useRemoveEmail

function useRemoveEmail(mutationArgs?): UseRemoveEmailResult;

Defined in: account-kit/react/src/hooks/useRemoveEmail.ts:44

A custom hook to handle the removal of an email from an already authenticated account, which includes executing a mutation with optional parameters.

import { useRemoveEmail } from "@account-kit/react";
 
const { removeEmail, isRemovingEmail, error } = useRemoveEmail({
  // these are optional
  onSuccess: () => {
    // do something on success
  },
  onError: (error) => console.error(error),
});

ParameterTypeDescription

mutationArgs?

Partial<Omit<UseMutationOptions<void, Error, void, unknown>, "mutationFn" | "mutationKey">>

Optional arguments for the mutation used for removing an email.

UseRemoveEmailResult

An object containing the removeEmail function, removeEmailAsync for async execution, a boolean isRemovingEmail to track the mutation status, and any error encountered.

Was this page helpful?