Hook Ecosystem
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
) - Payment Hooks: Handle crypto payments and exchange integrations (
usePay
,useAvailableExchanges
,usePayUrlActions
,useExchangeBuyStatus
) - Multi-Wallet Hooks: Manage multiple wallet connections (
useAppKitConnections
,useAppKitConnection
) - Authentication Hooks: Handle authentication and user management (
useAppKitUpdateEmail
,useAppKitSIWX
) - Solana-Specific Hooks: Solana blockchain interactions (
useAppKitConnection
from Solana adapter)
useAppKit
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.Use Cases
- Opening the modal when a user clicks a “Connect Wallet” button
- Closing the modal after a successful connection
- Opening specific views of the modal (e.g., account view, connect view)
- Handling custom wallet connection flows
Returns
open
: Function to open the modalclose
: Function to close the modal
Parameters
You can also select the modal’s view when calling theopen
function
Namespace | Description |
---|---|
solana | For connecting to Solana wallets |
bip122 | For connecting to Bitcoin wallets |
eip155 | For connecting to Ethereum wallets |
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 |
useAppKitAccount
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.Use Cases
- Displaying the connected wallet address in your UI
- Checking if a user is connected before showing certain features
- Getting user information for embedded wallets
- Handling multi-chain scenarios where you need account info for specific chains
Related hooks: useAppKitWallet, useDisconnect
Returns
allAccounts
: A list of connected accountsaddress
: The current account addresscaipAddress
: The current account address in CAIP formatisConnected
: Boolean that indicates if the user is connectedstatus
: The current connection statusembeddedWalletInfo
: The current embedded wallet information
Getting Bitcoin Public Keys
When working with Bitcoin accounts, you can extract public keys from the connected accounts:useAppKitWallet

Options for the connect parameter
AppKit supports the top 32 wallets, WalletConnect, social logins, and email authentication:Type | Options |
---|---|
QR Code | walletConnect |
Wallets | metamask, trust, coinbase, rainbow, coinbase, jupiter, solflare, coin98, magic-eden, backpack, frontier, xverse, okx, bitget, leather, binance, uniswap, safepal, bybit, phantom, ledger, timeless-x, safe, zerion, oneinch, crypto-com, imtoken, kraken, ronin, robinhood, exodus, argent and tokenpocket |
Social logins | google, github, apple, facebook, x, discord and farcaster |
Use Cases
useAppKitWallet
enables:
-
Direct Wallet Integration
- Direct connection to specific wallets (e.g., MetaMask, Coinbase)
- Streamlined connection flow without modal
-
Social Authentication
- Social login options (Google, GitHub, etc.)
- Email-based authentication
-
Custom Wallet Selection
- Branded wallet selection interface
- Custom styling and filtering options
-
Network-Specific Access
- Chain-specific wallet options
- Conditional wallet availability
-
Enhanced UX
- Loading states and error handling
- Custom notifications
- Responsive connection states
-
Multichain Support
- Connect to specific blockchain namespaces
- Target wallets for specific chains (EVM, Solana, Bitcoin)
Multichain Examples
Parameters
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 default namespace from your AppKit configuration
useAppKitNetwork
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.Use Cases
- Displaying the current network/chain in your UI
- Switching networks when a user selects a different chain
- Validating if a user is on the correct network for your dApp
- Handling network-specific features or contracts
Related hooks: useAppKitBalance, useWalletInfo
Returns
caipNetwork
: The current network objectcaipNetworkId
: The current network id in CAIP formatchainId
: The current chain idswitchNetwork
: Function to switch the network. Accepts acaipNetwork
object as argument.
See how to import or create a networks
here.
useAppKitBalance
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.Use Cases
- Displaying the user’s wallet balance in your UI
- Checking if a user has sufficient funds before initiating a transaction
- Monitoring balance changes after transactions
- Implementing balance-based features or UIs
Related hooks: useAppKitAccount, useAppKitNetwork
Returns
fetchBalance
: Async function that returns the current balance of the connected wallet
useAppKitState
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.Use Cases
- Syncing your UI with the modal’s open/closed state
- Tracking which network the user has selected
- Creating custom UI elements that respond to modal state changes
- Implementing custom loading states based on modal state
- Checking if AppKit has been fully initialized before rendering components
- Displaying chain-specific UI based on the active blockchain namespace
Returns
initialized
: Boolean that indicates if AppKit has been initialized. This sets to true when all controllers, adapters and internal state is readyloading
: Boolean that indicates if AppKit is loadingopen
: Boolean that indicates if the modal is openselectedNetworkId
: The current chain id selected by the user in CAIP-2 formatactiveChain
: The active chain namespace (e.g., ‘eip155’, ‘solana’, ‘bip122’)
Example Usage
useAppKitTheme
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.Use Cases
- Implementing dark/light mode in your dApp
- Customizing the modal’s appearance to match your brand
- Creating theme-specific UI elements
- Syncing the modal’s theme with your app’s theme
useAppKitEvents
The event subscription hook that allows you to listen to modal and wallet events. Use this hook when you need to track user interactions, implement analytics, or respond to specific wallet events in your application.Use Cases
- Tracking user interactions with the modal
- Implementing analytics for wallet connections
- Creating custom notifications for connection events
- Handling specific wallet events in your application
useDisconnect
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.Parameters
namespace
(optional): The specific chain namespace to disconnect from. If not provided, disconnects from all connected namespaces.
Use Cases
- Implementing a “Disconnect Wallet” button
- Handling logout flows in your application
- Cleaning up resources when a user disconnects
- Resetting application state after disconnection
- Disconnecting from specific chains in multi-chain applications
useWalletInfo
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.Use Cases
- Displaying wallet-specific information in your UI
- Implementing wallet-specific features
- Showing wallet icons or branding
- Handling wallet-specific behaviors
useAppKitProvider
Hook that returns thewalletProvider
and the WalletProviderType
for interacting with the connected wallet across different blockchain adapters.
Use Cases
- Accessing the wallet provider for direct blockchain interactions
- Signing transactions and messages with the connected wallet
- Integrating with blockchain-specific libraries (ethers, solana web3, etc.)
- Building custom wallet interactions across different chains
Adapter Examples
Related hooks: useAppKitAccount, useAppKitNetwork
useAppKitConnections
Hook that manages multiple wallet connections and provides access to all connected wallets. Use this hook when building applications that support multiple simultaneous wallet connections.Use Cases
- Managing multiple wallet connections simultaneously
- Building multi-wallet dashboards or portfolio views
- Implementing wallet comparison features
- Creating advanced wallet management interfaces
Returns
connections
: Array of all connected wallet connectionsdisconnect
: Function to disconnect a specific wallet connection
Related hooks: useAppKitConnection, useAppKitAccount
useAppKitConnection
Hook that manages the active wallet connection and provides connection switching capabilities. Use this hook when you need to work with the currently active connection or switch between multiple connections.Use Cases
- Switching between multiple connected wallets
- Accessing the currently active wallet connection
- Building connection management interfaces
- Implementing wallet-specific features based on the active connection
Returns
connection
: The currently active wallet connectionswitchConnection
: Function to switch to a different connected wallet
Related hooks: useAppKitConnections, useAppKitAccount
usePay
Hook that manages payment modal interactions and handles crypto payment flows. Use this hook when implementing payment features with exchange integrations.Use Cases
- Implementing crypto payment flows in your application
- Handling payment success and error states
- Integrating with centralized exchanges for payments
- Building custom payment interfaces
Parameters
onSuccess
: Optional callback function called when payment succeedsonError
: Optional callback function called when payment fails
Returns
pay
: Function to initiate a payment with specified parametersisLoading
: Boolean indicating if a payment is in progresserror
: Error object if payment fails
Related hooks: useAvailableExchanges, usePayUrlActions
useAvailableExchanges
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.Use Cases
- Displaying available exchanges to users
- Filtering exchanges based on asset or network
- Building custom exchange selection interfaces
- Implementing exchange comparison features
Parameters
isFetchOnInit
: Whether to fetch exchanges on hook initializationasset
: Filter exchanges by specific assetamount
: Filter exchanges by minimum amountnetwork
: Filter exchanges by network support
Returns
data
: Array of available exchangesisLoading
: Boolean indicating if exchanges are being fetchederror
: Error object if fetching failsfetch
: Function to manually refetch exchanges
Related hooks: usePay, usePayUrlActions
usePayUrlActions
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.Use Cases
- Building custom exchange integration flows
- Implementing exchange URL generation
- Creating custom payment interfaces
- Tracking exchange sessions for status monitoring
Returns
getUrl
: Function that returns exchange URL and session IDopenUrl
: Function that opens exchange URL and returns session data
Related hooks: useExchangeBuyStatus, useAvailableExchanges
useExchangeBuyStatus
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.Use Cases
- Tracking payment transaction status
- Implementing payment progress indicators
- Handling payment completion and failure states
- Building real-time payment monitoring
Parameters
exchangeId
: The exchange identifiersessionId
: The session ID from payment URL actionspollingInterval
: How often to check status (in milliseconds)isEnabled
: Whether to enable status pollingonSuccess
: Callback for successful payment completiononError
: Callback for payment errors
Returns
data
: Current payment status dataisLoading
: Boolean indicating if status is being fetchederror
: Error object if status fetching failsrefetch
: Function to manually refetch status
Related hooks: usePayUrlActions, usePay
useAppKitUpdateEmail
Hook that updates user email address with success and error handling. Use this hook when implementing email update functionality for user accounts.Use Cases
- Implementing email update functionality
- Building user profile management interfaces
- Handling email verification flows
- Creating account settings pages
Parameters
onSuccess
: Optional callback function called when email update succeedsonError
: Optional callback function called when email update fails
Returns
data
: Updated email data objecterror
: Error object if update failsisPending
: Boolean indicating if update is in progressisError
: Boolean indicating if there was an errorisSuccess
: Boolean indicating if update was successfulupdateEmail
: Function to trigger email update
Related hooks: useAppKitAccount, useAppKitWallet
useAppKitSIWX
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.Use Cases
- Implementing custom Sign In With X flows
- Accessing SIWX configuration for custom authentication
- Building protocol-specific authentication interfaces
- Handling multi-protocol sign-in scenarios
Returns
siwxConfig
: The current SIWX configuration object, or undefined if not configured
Related hooks: useAppKitAccount, useAppKitUpdateEmail
useAppKitConnection (Solana)
Solana-specific hook that provides access to the Solana connection instance for blockchain interactions. Use this hook when building Solana-specific features.Use Cases
- Accessing Solana connection for blockchain interactions
- Building Solana-specific transaction flows
- Implementing Solana program interactions
- Creating Solana wallet features
Returns
connection
: The Solana connection instance, or undefined if not connected
This is the Solana-specific version of useAppKitConnection. For general connection management, see useAppKitConnection.