For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

React hooks for Web3Auth Modal

Embedded Wallets offers a comprehensive suite of React hooks to streamline integration and state management within your React applications. These hooks abstract away common authentication and wallet operations, enabling you to implement Embedded Wallets' features with minimal boilerplate. Each hook is focused on a specific aspect of Embedded Wallets' functionality, making it easy to implement authentication, wallet operations, and blockchain interactions in your React projects.

List of React hooks​

tip

For detailed usage, configuration options, and code examples, refer to the dedicated documentation page for each hook.

Web3Auth hooks​

Hook NameDescription
useWeb3AuthCore hook for Embedded Wallets initialization and state management.

Authentication hooks​

Hook NameDescription
useWeb3AuthConnectHandles Embedded Wallets connection processes.
useWeb3AuthDisconnectManages disconnection from Embedded Wallets.

Identity hooks​

Hook NameDescription
useAuthTokenInfoRetrieves and manages identity tokens.
useWeb3AuthUserProvides access to the authenticated user's information.

Blockchain hooks​

Hook NameDescription
useChainReturns the active chain ID and chain namespace.
useSwitchChainAllows switching between different blockchain networks.

Wallet and account linking hooks​

Hook NameDescription
useWalletsLists the wallets connected in the user's session.
useLinkAccountLinks or unlinks external wallets. Import from account-linking/react.
useSwitchAccountSwitches the active wallet to a linked account. Import from account-linking/react.

Multi-Factor Authentication hooks​

Hook NameDescription
useEnableMFAEnables Multi-Factor Authentication (MFA) for enhanced security.
useManageMFAProvides functionality to manage MFA settings.

Wallet Services plugin hooks​

Hook NameDescription
useWalletConnectScannerIntegrates WalletConnect scanner functionality.
useWalletUIManages wallet UI components and user interactions.
useCheckoutFacilitates cryptocurrency checkout processes.
useSwapEnables token swapping capabilities.
useFundingOpens the Wallet Services funding interface.
useReceiveOpens the Wallet Services receive interface.
useWalletServicesPluginProvides access to Wallet Services plugins.

Payment hooks​

Hook NameDescription
useX402FetchMakes x402 payment-gated fetch requests. Import from @web3auth/modal/x402/react.