Use this file to discover all available pages before exploring further.
Hooks are React functions that provide access to wallet connection features, modal controls, blockchain interactions, and wallet event subscriptions. They enable you to manage wallet connections, handle user authentication, interact with smart contracts, and respond to wallet events in your application.
AppKit provides a comprehensive set of React hooks that work together to provide a complete wallet connection and blockchain interaction experience. These hooks can be categorized into several functional groups:
Connection Hooks: Manage wallet connections and user authentication (useAppKit, useAppKitAccount, useAppKitProvider, useDisconnect)
Network Hooks: Handle blockchain network selection and information (useAppKitNetwork)
UI Control Hooks: Control the modal and UI elements (useAppKitState, useAppKitTheme)
Data Access Hooks: Access wallet and blockchain data (useAppKitBalance, useWalletInfo)
Event Hooks: Subscribe to wallet and connection events (useAppKitEvents)
Authentication Hooks: Handle authentication and user management (useAppKitUpdateEmail, useAppKitSIWX)
Solana-Specific Hooks: Solana blockchain interactions (useAppKitConnection from Solana adapter)
The diagram below illustrates how these hooks relate to each other and to the core AppKit functionality:These hooks provide a modular way to integrate wallet functionality into your application, allowing you to use only the features you need.
The primary hook for controlling the modal’s visibility and behavior. Use this hook when you need to programmatically open or close the modal, or when you want to show specific views like the connection screen or account details.
import { useAppKit } from "@reown/appkit/react";export default function Component() { const { open, close } = useAppKit();}
You can also select the modal’s view when calling the open function
open({ view: "Account" });// to connect and show multi wallets viewopen({ view: "Connect" });// to connect and show only solana walletsopen({ view: "Connect", namespace: "solana" });// to connect and show only bitcoin walletsopen({ view: "Connect", namespace: "bip122" });// to connect and show only ethereum walletsopen({ view: "Connect", namespace: "eip155" });// to open swap with argumentsopen({ view: 'Swap', arguments: { amount: '321.123', fromToken: 'USDC', toToken: 'ETH' }})// to open wallet send interfaceopen({ view: 'WalletSend' })
Available namespaces for the Connect view:
Namespace
Description
solana
For connecting to Solana wallets
bip122
For connecting to Bitcoin wallets
eip155
For connecting to Ethereum wallets
List of views you can select:
Variable
Description
Connect
Principal view of the modal - default view when disconnected. A namespace can be selected to connect to a specific network (solana, bip122 or eip155)
Account
User profile - default view when connected
AllWallets
Shows the list of all available wallets
Networks
List of available networks - you can select and target a specific network before connecting
WhatIsANetwork
”What is a network” onboarding view
WhatIsAWallet
”What is a wallet” onboarding view
OnRampProviders
On-Ramp main view
WalletSend
Token sending interface that allows users to send tokens to another address
Swap
Swap main view
ProfileWallets
View for managing connected wallets in the user profile
The essential hook for accessing wallet connection state and user information. Use this hook whenever you need to know if a user is connected, get their wallet address, or access their embedded wallet details.
The direct wallet connection hook that enables connectivity to specific wallets without opening the modal. Use this hook when you want to provide direct wallet buttons, create a customized wallet selection interface, or implement social login options.Using the wallet button hooks (Demo in our Lab), you can directly connect to more than 40 of the top wallets globally, WalletConnect QR, and all the social logins.
This hook allows to customize dApps, enabling users to connect their wallets effortlessly, all without the need to open the traditional modal.
Execute this command to install the library for use it:
npm install @reown/appkit-wallet-button
Then you have to import the hook in your project:
import { useAppKitWallet } from "@reown/appkit-wallet-button/react";
And finally, you can use the hook in your project:
The network management hook that provides access to chain information and network switching capabilities. Use this hook when you need to display the current network, switch between networks, or validate network compatibility.
The balance management hook that provides functions to fetch the native token balance of the connected wallet. Use this hook when you need to display the user’s balance, check if they have sufficient funds for a transaction, or track balance changes.
The state management hook that provides real-time access to the modal’s current state. Use this hook when you need to react to modal state changes or synchronize your UI with the modal’s status.
The theming hook that controls the visual appearance of the modal. Use this hook when you need to customize the modal’s colors, implement dark/light mode, or match the modal’s appearance with your application’s theme.
Subscribes to modal, wallet, and transaction events emitted by AppKit. Useful for analytics, telemetry, custom notifications, or reacting to specific user actions.
import { useAppKitEvents } from "@reown/appkit/react";const events = useAppKitEvents();
The hook returns the latest event object. Each time a new event is emitted, the component re-renders with the new value:
{ timestamp: number data: { type: 'track' | 'error' event: string // the event name properties?: object // event-specific payload }}
The session management hook that handles wallet disconnection. Use this hook when implementing logout functionality or when you need to clean up resources after a user disconnects their wallet.
import { useDisconnect } from "@reown/appkit/react";const { disconnect } = useDisconnect();// Disconnect from all namespacesawait disconnect();// Disconnect from specific namespaceawait disconnect({ namespace: 'eip155' }); // Disconnect from Ethereumawait disconnect({ namespace: 'solana' }); // Disconnect from Solana await disconnect({ namespace: 'bip122' }); // Disconnect from Bitcoin
The wallet information hook that provides details about the connected wallet. Use this hook when you need to display wallet-specific information, show wallet branding, or implement wallet-specific features.
Hook that manages multiple wallet connections and provides access to all connected wallets. This hook enables multi-wallet functionality, allowing users to connect and manage multiple wallets simultaneously within your application.
Multi-wallet functionality must be enabled in your AppKit configuration. This feature requires a Pro or Enterprise plan and must be activated in your Reown Cloud dashboard.
Hook that manages the active wallet connection and provides connection switching capabilities. This hook enables you to work with the currently active connection, switch between multiple connected wallets, and delete wallet connections from the recent list.
Multi-wallet functionality must be enabled in your AppKit configuration. This feature requires a Pro or Enterprise plan and must be activated in your Reown Cloud dashboard.
The hook accepts an optional configuration object with the following properties:
namespace (optional): The blockchain namespace to target. Supported values:
'eip155' - Ethereum and EVM-compatible chains
'solana' - Solana blockchain
'bip122' - Bitcoin blockchain
If not specified, uses the currently active namespace
onSuccess (optional): Callback function called when a connection operation succeeds
onSuccess?: (params: { address: string; // The address that was switched to or deleted namespace: ChainNamespace; // The blockchain namespace hasSwitchedAccount: boolean; // True if switched to different account in same wallet hasSwitchedWallet: boolean; // True if switched to different wallet hasDeletedWallet: boolean; // True if a wallet connection was deleted}) => void;
onError (optional): Callback function called when a connection operation fails
isPending: Boolean indicating if a connection operation is in progress
switchConnection: Function to switch to a different connected wallet or account
switchConnection: (params: { connection: Connection; // The connection to switch to address?: string; // Optional: specific account address to switch to}) => Promise<void>;
deleteConnection: Function to remove a wallet connection from the recent connections list
deleteConnection: (params: { address: string; // Account address to delete connectorId: string; // Connector ID of the wallet to delete}) => void;
Hook that manages payment modal interactions and handles crypto payment flows. Use this hook when implementing payment features with exchange integrations.
Hook that fetches and manages the state for available exchanges. Use this hook when you need to display available payment options or filter exchanges based on criteria.
Hook that provides functions to interact with specific exchange URLs, returning the sessionId needed for status tracking. Use this hook when implementing custom exchange flows.
import { usePayUrlActions } from "@reown/appkit-pay/react";const { getUrl, openUrl } = usePayUrlActions();// Get exchange URLconst { url, sessionId } = await getUrl('binance', { asset: 'ETH', amount: 0.1, recipient: '0x...'});// Open exchange URL in new tabconst { url, sessionId } = await openUrl('coinbase', { asset: 'USDC', amount: 100, recipient: '0x...'}, true);
Hook that fetches and polls for the status of a headless payment transaction using exchangeId and sessionId. Use this hook to track payment progress and handle completion.
Hook that provides access to Sign In With X (SIWX) configuration and state. Use this hook when implementing custom authentication flows with various blockchain protocols.
import { useAppKitSIWX } from "@reown/appkit/react";const siwxConfig = useAppKitSIWX();if (siwxConfig) { console.log('SIWX enabled with config:', siwxConfig);}
Solana-specific hook that provides access to the Solana connection instance for blockchain interactions. Use this hook when building Solana-specific features.
import { useAppKitConnection } from "@reown/appkit-adapter-solana/react";const { connection } = useAppKitConnection();if (connection) { // Use connection for Solana blockchain interactions const balance = await connection.getBalance(publicKey);}
Hook that returns the walletProvider and the WalletProviderType.
import { useAppKitAccount, useAppKitProvider } from "@reown/appkit/react";import type { Provider } from "@reown/appkit-adapter-solana";function SignMessage() { // 0. Get account and provider const { address } = useAppKitAccount(); const { walletProvider } = useAppKitProvider<Provider>("solana"); // 1. Create a function to sign a message async function onSignMessage() { try { if (!walletProvider || !address) { throw Error("user is disconnected"); } // 2. Encode message and sign it const encodedMessage = new TextEncoder().encode("Hello from AppKit"); const signature = await walletProvider.signMessage(encodedMessage); console.log(signature); } catch (err) { // Handle Error Here } } // 3. Create a button to trigger the function return <button onClick={onSignMessage}>Sign Message</button>;}