Skip to content

useAuthenticate

Provides functions and state for authenticating a user using a signer. It includes methods for both synchronous and asynchronous mutations.

Import

import { useAuthenticate } from "@account-kit/react";

Usage

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

Parameters

mutationArgs

UseAuthenticateMutationArgs Optional mutation arguments to configure the authentication mutation

Returns

UseAuthenticateResult An object containing functions and state for handling user authentication, including methods for synchronously and asynchronously executing the authentication