Alchemy Logo

useConnect

const useConnect: (params?) => UseConnectReturnType<Config>;

Defined in: account-kit/react/dist/types/hooks/useConnect.d.ts:25

Re-exported wagmi hook for connecting an EOA. This hook uses the internal wagmi config though so that the state is in sync with the rest of the Alchemy Account hook state. Useful if you wnat to connect to an EOA.

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

ParameterTypeDescription

params?

UseConnectParameters<Config>["mutation"]

mutation parameters to use for the connect mutation

UseConnectReturnType<Config>

the wagmi useConnect return type

Was this page helpful?