Alchemy Logo

useRemovePasskey

function useRemovePasskey(mutationArgs?): UseRemovePasskeyResult;

Defined in: account-kit/react/src/hooks/useRemovePasskey.ts:42

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

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

ParameterTypeDescription

mutationArgs?

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

Optional arguments for the mutation used for removing a passkey. ref

UseRemovePasskeyResult

An object containing the removePasskey function, removePasskeyAsync for async execution, a boolean isRemovingPasskey to track the mutation status, and any error encountered. ref

Was this page helpful?