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
useIdentityTokenRetrieves and manages identity tokens.
useWeb3AuthUserProvides access to the authenticated user's information.

Blockchain hooks

Hook NameDescription
useSwitchChainAllows switching between different blockchain networks.

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.
useWalletServicesPluginProvides access to Wallet Services plugins.