Skip to main content
AppKit for React Native provides a set of hooks to interact with the wallet connection lifecycle, access connection state, and control the modal. All hooks are imported from @reown/appkit-react-native.

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)
  • Disconnecting users from their wallets
  • Switching between different blockchain networks

Returns

  • open: Function to open the modal
  • close: Function to close the modal
  • disconnect: Function to disconnect the current session
  • switchNetwork: Function to switch to a different chain/network. Accepts an AppKitNetwork object or a CAIP network ID string (e.g., 'eip155:1')

Parameters

You can direct the modal to open to a specific view using the open function:
Here is a list of possible views you can select:
VariableDescription
ConnectPrincipal view of the modal - default view when disconnected.
WalletConnectView with a QR code to scan with wallets and connect via WalletConnect
AccountUser profile - default view when connected.
NetworksList 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.
switchNetwork You can switch networks by passing either an AppKitNetwork object or a CAIP network ID string:

useAccount()

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 account 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 authentication flows
  • Handling multi-chain scenarios where you need account info for specific chains
  • Implementing conditional rendering based on connection status
  • Accessing the active blockchain namespace for chain-specific logic
  • Getting detailed chain information for network-specific features

Returns

  • allAccounts: Array of all connected accounts across all connections. Each account includes address, type, and namespace. Accounts also include caipAddress (CAIP-10 format) and chainId when network information is available. (Account[])
  • address: The connected account address (string)
  • chainId: The chain ID of the currently active connection (number or string)
  • isConnected: Boolean indicating if a wallet is connected on the current chain/namespace
  • namespace: The active namespace (string, e.g., ‘eip155’, ‘solana’, ‘bip122’)
  • chain: The active chain object with detailed chain information (AppKitNetwork type)
The Account type has the following structure:
PropertyTypeDescription
addressstringThe blockchain address of the account
namespacestringThe blockchain namespace (e.g., ‘eip155’, ‘solana’, ‘bip122’)
chainIdstringThe chain ID where this account is active
typeAccountType?Optional account type (e.g., ‘eoa’ or ‘smartAccount’)
caipAddressstring?CAIP-10 formatted address. Present when network information is available.
publicKeystring?Bitcoin public key. Only present for Bitcoin (bip122) accounts.

useProvider()

The provider access hook that provides access to the underlying chain-specific provider for the currently active connection. Use this hook when you need to perform direct interactions with the blockchain that go beyond the standard AppKit actions. By default, useProvider() returns the provider for the currently active network.

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
  • Performing advanced blockchain operations not covered by AppKit’s standard actions

Returns

  • provider: The underlying chain-specific provider for the currently active connection
  • providerType: The type of provider (e.g., ‘eip155’, ‘solana’, ‘bip122’)
Refer to the example usage in:

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
  • Creating custom wallet selection interfaces

Returns

  • walletInfo: Object containing metadata about the connected wallet (name, icon, rdns, id, etc.)
The exact structure of walletInfo can be found in the WalletInfo type definition in packages/common/src/utils/TypeUtil.ts.

useAppKitEventSubscription()

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
  • Monitoring connection state changes

Parameters

  • eventType: The specific event type to subscribe to (e.g., ‘MODAL_OPEN’, ‘CONNECT_SUCCESS’)
  • callback: Function that is executed when the event is triggered
The full list of event types and their payloads can be found in AppKitEvents within packages/core/src/utils/TypeUtil.ts.

useAppKitState()

The state management hook that provides real-time access to the modal’s current state and connection status. 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
  • Creating custom UI elements that respond to modal state changes
  • Implementing custom loading states based on modal state
  • Checking connection status without accessing account details
  • Displaying chain-specific UI based on the connected blockchain

Returns

  • isOpen: Boolean indicating if the modal is currently open
  • isLoading: Boolean indicating if the modal is loading
  • isConnected: Boolean indicating if a user is connected
  • chain: The connected chain object

useAppKitTheme()

The theme control hook that provides access to the modal’s visual appearance settings. Use this hook when you need to dynamically change the theme mode or customize theme variables at runtime, such as implementing a dark/light mode toggle or matching the modal’s appearance with your application’s theme.

Use Cases

  • Implementing a dark/light mode toggle in your app
  • Matching the modal’s appearance with your application’s theme
  • Dynamically changing the accent color based on user preferences
  • Resetting the theme to follow the system setting

Returns

  • themeMode: The current theme mode ('dark' or 'light')
  • themeVariables: The current theme variables object
  • setThemeMode: Function to set the theme mode. Pass 'dark', 'light', or undefined to revert to the system theme
  • setThemeVariables: Function to update theme variables. Pass undefined or {} to clear custom variables
The following theme variables are currently supported:
VariableDescriptionType
accentColor used for buttons, icons, labels, etc.string

useAppKitLogs()

The logging hook that provides access to AppKit’s internal logging system. Use this hook when you need to debug your application, monitor AppKit’s behavior, or export logs for troubleshooting purposes.

Use Cases

  • Debugging AppKit behavior and troubleshooting issues
  • Monitoring application performance and error tracking
  • Exporting logs for support or analysis purposes
  • Building custom debugging interfaces for development
  • Filtering logs by severity level or time range

Returns

  • logs: All logs from AppKit (array of LogEntry objects)
  • errorLogs: Error-level logs only (array of LogEntry objects)
  • warningLogs: Warning-level logs only (array of LogEntry objects)
  • infoLogs: Info-level logs only (array of LogEntry objects)
  • debugLogs: Debug-level logs only (array of LogEntry objects)
  • getLogsByLevel: Function to get logs filtered by level (error, warn, info, debug)
  • getRecentLogs: Function to get recent logs (default: 100, accepts count parameter)
  • exportLogs: Function to export all logs as JSON string
  • getLogsStats: Function to get logging statistics by level
  • clearLogs: Function to clear all logs
This hook requires the debug option to be set to true in your AppKit configuration to capture logs. See the Options documentation for more details.

Deprecated Hooks

useDisconnect()

The functionality of useDisconnect (which previously exposed a disconnect function) is now available directly from the useAppKit() hook.