useAppKit
Composable function for controlling the modal.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
useAppKitAccount
Composable function for accessing account data and connection status.Returns
accountData.value.address
: The current account addressaccountData.value.caipAddress
: The current account address in CAIP formataccountData.value.isConnected
: Boolean that indicates if the user is connectedaccountData.value.status
: The current connection status
Getting Bitcoin Public Keys
When working with Bitcoin accounts, you can extract public keys from the connected accounts:useAppKitNetwork
Composable function for accessing network data and methods.Returns
networkData.caipNetwork
: The current network objectnetworkData.caipNetworkId
: The current network id in CAIP formatnetworkData.chainId
: The current chain idnetworkData.switchNetwork
: Function to switch the network. Accepts acaipNetwork
object as argument.
switchNetwork Usage
See how to import or create a networks
here.
useAppKitState
Composable function for getting the current value of the modal’s state.Returns
stateData.initialized
: Boolean that indicates if AppKit has been initialized. This sets to true when all controllers, adapters and internal state is readystateData.loading
: Boolean that indicates if AppKit is loadingstateData.open
: Boolean that indicates if the modal is openstateData.selectedNetworkId
: The current chain id selected by the user in CAIP-2 formatstateData.activeChain
: The active chain namespace (e.g., ‘eip155’, ‘solana’, ‘bip122’)
Example Usage
useAppKitTheme
Composable function for controlling the modal’s theme.Returns
themeAction.themeMode
: Get theme Mode.themeAction.themeVariables
: Get theme variables.themeAction.setThemeMode
: Set theme Mode. Accepts a string as parameter (‘dark’ | ‘light’)themeAction.setThemeVariables
: Set theme variables. Check the example usage.
Example Usage
useAppKitEvents
Composable function for subscribing to modal events.Returns
events.timestamp
: Get the timestamp of the eventevents.data.event
: Get string of the event.events.data.properties
: get more information from the event.
useDisconnect
Composable function for disconnecting the session.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
Composable function for accessing wallet information.useAppKitProvider
Composable function that returns thewalletProvider
and the WalletProviderType
for interacting with the connected wallet across different blockchain adapters.
Use Cases
- Direct wallet interactions (signing messages, sending transactions)
- Access to wallet-specific methods and properties
- Integration with blockchain libraries (Ethers, Wagmi, Solana Web3.js)
Examples
Returns
walletProvider
: The wallet provider instance for the specified chain namespacewalletProviderType
: The type of wallet provider currently connected
Ethereum/Solana Library
You can use Wagmi actions to sign messages, interact with smart contracts, and much more.
getAccount
Action for accessing account data and connection status.signMessage
Action for signing messages with connected account.useAppKitProvider
Hook that returns thewalletProvider
and the WalletProviderType
.