Skip to main content
Every hook exported by @dynamic-labs-sdk/react-hooks is listed here, grouped by category. All hooks require a DynamicProvider ancestor.
New to the hooks? Read How React Hooks Work first — it covers the naming rule, which functions get a hook, and the three shapes (query, mutation, state).
For each hook the table shows:
  • Hook — the import name from @dynamic-labs-sdk/react-hooks
  • Wraps — the client function from @dynamic-labs-sdk/client
  • Shapequery (async read, returns { data, isLoading, error, refetch }), mutation (async action, returns { mutate, isPending, error, data }), or state (reactive value, returns { data, isLoading, error, refetch })

State hooks

State hooks subscribe to reactive client state and re-render when it changes. They take no arguments and return the TanStack Query result — destructure data to get the value.
HookValue on dataRe-renders when
useUserCurrent authenticated user, or nullSign-in, sign-out, profile update
useGetWalletAccountsAll wallet accounts (verified + unverified)Connect, disconnect, verify
useGetUserSocialAccountsLinked social accounts (SocialAccount[])User changes
useGetAvailableWalletProvidersDataConnectable wallet providers (WalletProviderData[])Network switch, provider changes
useInitStatus'uninitialized' | 'in-progress' | 'finished' | 'failed'Initialization progress
useSessionExpiresAtSession expiration Date, or nullSession updates
import { useUser, useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';

const { data: user } = useUser();
const { data: walletAccounts = [] } = useGetWalletAccounts();

Event hooks

Event hooks subscribe to client events for a component’s lifetime. They auto-unsubscribe on unmount — no manual offEvent cleanup needed.
HookDescription
useOnEventSubscribe to any client event. Re-subscribes when event changes; listener identity changes do not re-subscribe (ref-wrapped).
useOnceEventLike useOnEvent, but fires at most once per mount.
useOnWalletProviderEventSubscribe to events on a specific wallet provider (e.g. accountsChanged, chainChanged).
import { useOnEvent } from '@dynamic-labs-sdk/react-hooks';

useOnEvent({
  event: 'walletAccountsChanged',
  listener: ({ walletAccounts }) => console.log(walletAccounts),
});
import { useOnceEvent } from '@dynamic-labs-sdk/react-hooks';

useOnceEvent({
  event: 'authFlowCancelled',
  listener: () => console.log('auth flow cancelled'),
});
import { useOnWalletProviderEvent } from '@dynamic-labs-sdk/react-hooks';

useOnWalletProviderEvent({
  event: 'chainChanged',
  walletProviderKey: 'metamask',
  listener: (chainId) => console.log('chain:', chainId),
});

Context

Hook / ComponentDescription
DynamicProviderReact context provider. Wraps your app and supplies the client instance to all hooks.
useDynamicClientReturns the DynamicClient from context. Use for one-shot direct client calls inside handlers.

Query hooks

Query hooks wrap async read functions. They fetch on mount and return { data, isLoading, isFetching, error, refetch }. Arguments that accept undefined are pseudo-required — the hook stays disabled until a real value is passed. Pass queryParams to override TanStack Query options (staleTime, refetchInterval, enabled, etc.).

Wallets & balances

HookWrapsDescription
useGetNativeBalancegetNativeBalanceNative token balance for a wallet account.
useGetBalanceForAddressgetBalanceForAddressBalance for a specific address string.
useGetTokenBalancesgetTokenBalancesERC-20 / SPL token balances for a wallet.
useGetMultichainTokenBalancesgetMultichainTokenBalancesToken balances across all connected chains.
useGetActiveNetworkDatagetActiveNetworkDataActive network metadata (chain ID, name, RPC URL).
useGetActiveNetworkIdgetActiveNetworkIdActive network chain ID.
useGetConnectedAddressesgetConnectedAddressesAll addresses the user has connected.
useGetWalletOptionsCataloguegetWalletOptionsCatalogueFull wallet picker catalog (grouped by category).
useGetWalletConnectCataloggetWalletConnectCatalogWalletConnect-compatible wallets from the registry.
useGetWalletConnectCatalogWalletByWalletProviderKeygetWalletConnectCatalogWalletByWalletProviderKeySingle WalletConnect wallet entry by provider key.
import { useGetNativeBalance } from '@dynamic-labs-sdk/react-hooks';

function Balance({ walletAccount }) {
  const { data, isLoading } = useGetNativeBalance({ walletAccount });

  if (isLoading) return <p>Loading...</p>;
  return <p>{data?.balance ?? '0'}</p>;
}

Authentication & security

HookWrapsDescription
useCheckStepUpAuthcheckStepUpAuthWhether a step-up auth token is valid for a given scope.
useIsMfaRequiredForActionisMfaRequiredForActionWhether MFA is required before performing a specific action.
useGetMfaDevicesgetMfaDevicesUser’s registered MFA devices.
useGetMfaMethodsgetMfaMethodsAvailable MFA method types for the current user.
useGetMfaRecoveryCodesgetMfaRecoveryCodesUser’s active recovery codes.
useGetPasskeysgetPasskeysUser’s registered passkeys.
useGetRegisteredDevicesgetRegisteredDevicesUser’s registered (trusted) devices.
useGetGoogleDriveBackupReadinessgetGoogleDriveBackupReadinessWhether the user’s Google OAuth scopes allow Drive key backup.

Fireblocks Flow & swaps

HookWrapsDescription
useGetFlowgetFlowFetch a Flow by ID. Pass queryParams.refetchInterval for polling.
useGetFlowQuotegetFlowQuoteGet a price quote for a Flow.
useGetSwapQuotegetSwapQuoteGet a quote for a token swap.
useGetSwapStatusgetSwapStatusPoll the status of an in-flight swap.
useGetTransactionHistorygetTransactionHistoryTransaction history for a wallet account.
import { useGetFlow } from '@dynamic-labs-sdk/react-hooks';

function FlowStatus({ flowId }) {
  const { data: flow, isLoading } = useGetFlow({
    flowId,
    queryParams: { refetchInterval: 3000 },
  });

  if (isLoading) return <p>Loading flow...</p>;
  return <p>Status: {flow?.status}</p>;
}

Funding

HookWrapsDescription
useGetCoinbaseBuyUrlgetCoinbaseBuyUrlGenerate a Coinbase onramp buy URL.
useGetKrakenAccountsgetKrakenAccountsUser’s linked Kraken exchange accounts.
useGetKrakenWhitelistedAddressesgetKrakenWhitelistedAddressesKraken whitelisted withdrawal addresses.
useGetMoonPayCurrenciesgetMoonPayCurrenciesCurrencies supported by MoonPay.
useGetMoonPayUrlgetMoonPayUrlGenerate a MoonPay purchase URL.

Mutation hooks

Mutation hooks wrap async write functions. They do not run on mount — call mutate(args) to trigger. Returns { mutate, isPending, data, error, reset }. Pass mutateParams to set TanStack Query mutation options (onSuccess, onError, retry, etc.).

Authentication

HookWrapsDescription
useSendEmailOTPsendEmailOTPSend a one-time password to an email address.
useSendSmsOTPsendSmsOTPSend a one-time password via SMS.
useVerifyOTPverifyOTPVerify a one-time password (email or SMS).
useSignInWithPasskeysignInWithPasskeySign in using a passkey.
useSignInWithExternalJwtsignInWithExternalJwtSign in with an external JWT from a custom auth provider.
useSignInWithSocialPopUpsignInWithSocialPopUpSign in via a social provider in a popup window.
useSignInWithSocialRedirectsignInWithSocialRedirectSign in via a social provider using a full-page redirect.
useCompleteSocialRedirectcompleteSocialRedirectComplete a social redirect after the provider callback.
useCompleteDeviceRegistrationcompleteDeviceRegistrationComplete a device registration flow.
useLogoutlogoutLog the current user out.
useRefreshAuthrefreshAuthRefresh the authentication token.
useRequestExternalAuthElevatedTokenrequestExternalAuthElevatedTokenRequest a step-up auth token for sensitive operations.
import { useSendEmailOTP, useVerifyOTP } from '@dynamic-labs-sdk/react-hooks';

function EmailLogin() {
  const { mutate: sendOtp, data: otpVerification } = useSendEmailOTP();
  const { mutate: verifyOtp } = useVerifyOTP();

  return (
    <>
      <button onClick={() => sendOtp({ email: 'user@example.com' })}>
        Send code
      </button>
      {otpVerification && (
        <button onClick={() => verifyOtp({ otp: '123456', otpVerification })}>
          Verify
        </button>
      )}
    </>
  );
}

MFA

HookWrapsDescription
useRegisterTotpMfaDeviceregisterTotpMfaDeviceRegister a new TOTP MFA device. Returns the QR code URI in data.
useAuthenticateTotpMfaDeviceauthenticateTotpMfaDeviceAuthenticate with a TOTP code.
useDeleteMfaDevicedeleteMfaDeviceDelete an MFA device.
useSetDefaultMfaDevicesetDefaultMfaDeviceSet a device as the default MFA method.
useAuthenticateMfaRecoveryCodeauthenticateMfaRecoveryCodeAuthenticate using a recovery code.
useCreateNewMfaRecoveryCodescreateNewMfaRecoveryCodesGenerate a new set of recovery codes.
useAcknowledgeRecoveryCodesacknowledgeRecoveryCodesAcknowledge that recovery codes have been saved.
useAuthenticatePasskeyMFAauthenticatePasskeyMFAAuthenticate with a passkey as MFA.
useRegisterPasskeyregisterPasskeyRegister a new passkey.
useDeletePasskeydeletePasskeyDelete a passkey.

Wallets

HookWrapsDescription
useConnectWithWalletProviderconnectWithWalletProviderConnect a wallet using a specific provider.
useConnectAndVerifyWithWalletProviderconnectAndVerifyWithWalletProviderConnect and verify (SIWE) a wallet in one step.
useVerifyWalletAccountverifyWalletAccountVerify ownership of a connected wallet account.
useRemoveWalletAccountremoveWalletAccountRemove a wallet account from the session.
useTransferWalletAccounttransferWalletAccountTransfer a wallet account to another user.
useProveWalletAccountOwnershipproveWalletAccountOwnershipProve wallet ownership via signature without full verification.
useAssertWalletAccountSigningAvailabilityassertWalletAccountSigningAvailabilityAssert that a wallet account can sign (throws if not).
useSignMessagesignMessageSign an arbitrary message with a wallet.
useAddNetworkaddNetworkAdd a network to the wallet provider.
useSwitchActiveNetworkswitchActiveNetworkSwitch the wallet’s active network.
useRevokeRegisteredDevicerevokeRegisteredDeviceRevoke a single registered device.
useRevokeAllRegisteredDevicesrevokeAllRegisteredDevicesRevoke all registered devices.
import { useSignMessage } from '@dynamic-labs-sdk/react-hooks';

function SignButton({ walletAccount }) {
  const { mutate: sign, data, isPending } = useSignMessage();

  return (
    <button
      onClick={() => sign({ walletAccount, message: 'gm' })}
      disabled={isPending}
    >
      {isPending ? 'Signing...' : 'Sign'}
    </button>
  );
}

User management

HookWrapsDescription
useUpdateUserupdateUserUpdate the current user’s profile.
useDeleteUserdeleteUserDelete the current user’s account.
useUnlinkSocialAccountunlinkSocialAccountUnlink a social account from the user.

Fireblocks Flow

HookWrapsDescription
useAttachFlowSourceattachFlowSourceAttach a funding source to a Flow.
useBroadcastFlowbroadcastFlowBroadcast a signed Flow transaction on-chain.
useCancelFlowcancelFlowCancel an in-progress Flow.
usePrepareFlowSigningprepareFlowSigningPrepare a Flow for signing (returns the transaction to sign).
useSubmitFlowTransactionsubmitFlowTransactionSubmit a signed transaction back to the Flow.
useConfirmTransactionconfirmTransactionConfirm a pending transaction.
useTransferAmounttransferAmountTransfer an amount of a token to an address.
useExecuteSwapTransactionexecuteSwapTransactionExecute a swap transaction.
import { useAttachFlowSource, useGetFlowQuote } from '@dynamic-labs-sdk/react-hooks';

function FlowSetup({ flowId, walletAccount }) {
  const { mutate: attachSource } = useAttachFlowSource();
  const { data: quote } = useGetFlowQuote({ flowId });

  return (
    <button onClick={() => attachSource({ flowId, walletAccount })}>
      Pay with wallet
    </button>
  );
}

Funding

HookWrapsDescription
useCreateCoinbaseOnrampOrdercreateCoinbaseOnrampOrderCreate a Coinbase onramp purchase order.
useAddCoinbaseOnrampOrderEventListeneraddCoinbaseOnrampOrderEventListenerListen for Coinbase onramp order status updates.
useCreateCryptoDotComPaymentcreateCryptoDotComPaymentCreate a Crypto.com payment session.
useCreateKrakenExchangeTransfercreateKrakenExchangeTransferInitiate a transfer from a Kraken account.

TypeScript

Every hook with parameters exports a UseXParams type alongside the hook:
import {
  useSignMessage,
  type UseSignMessageParams,
} from '@dynamic-labs-sdk/react-hooks';

const config: UseSignMessageParams = {
  mutateParams: {
    onSuccess: ({ signature }) => console.log(signature),
  },
};

const { mutate } = useSignMessage(config);