Use this file to discover all available pages before exploring further.
AppKit provides seamless integration with multiple blockchain ecosystems. It supports Wagmi and Ethers v6 on Ethereum,
@solana/web3.js on Solana, as well as Bitcoin, TON, TRON and other networks.
We recommend using Vite to get
started with AppKit JavaScript.
Try installing AppKit Skills to get AI-assisted guidance. Your AI coding assistant can help you set up, build, and debug your AppKit integration.To install AppKit Skills, run the following command in your terminal:
For a quick integration, you can use the createAppKit function with a unified configuration. This automatically applies the predefined configurations for different adapters like Wagmi, Ethers, or Solana, so you no longer need to manually configure each one individually. Simply pass the common parameters such as projectId, chains, metadata, etc., and the function will handle the adapter-specific configurations under the hood.This includes WalletConnect, Coinbase and Injected connectors, and the Blockchain API as a transportIn your main.js file set up the following configuration.
import { createAppKit } from '@reown/appkit'import { mainnet, arbitrum } from '@reown/appkit/networks'import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'// 1. Get a project ID at https://dashboard.reown.comconst projectId = 'YOUR_PROJECT_ID'export const networks = [mainnet, arbitrum]// 2. Set up Wagmi adapterconst wagmiAdapter = new WagmiAdapter({ projectId, networks})// 3. Configure the metadataconst metadata = { name: 'AppKit', description: 'AppKit Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932']}// 3. Create the modalconst modal = createAppKit({ adapters: [wagmiAdapter], networks: [mainnet, arbitrum], metadata, projectId, features: { analytics: true // Optional - defaults to your Cloud configuration }})// 4. Trigger modal programaticalyconst openConnectModalBtn = document.getElementById('open-connect-modal')const openNetworkModalBtn = document.getElementById('open-network-modal')openConnectModalBtn.addEventListener('click', () => modal.open())openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))// 5. Alternatively use w3m component buttons within the index.html file
Reown AppKit use Viem networks under the hood, which provide a wide variety of networks for EVM chains. You can find all the networks supported by Viem within the @reown/appkit/networks path.
import { createAppKit } from '@reown/appkit'import { mainnet, arbitrum, base, scroll, polygon } from '@reown/appkit/networks'
Looking to add a custom network? Check out the custom networks section.
In your main.js file set up the following configuration.
import { createAppKit } from "@reown/appkit";import { Ethers5Adapter } from "@reown/appkit-adapter-ethers5";import { mainnet, arbitrum } from "@reown/appkit/networks";// 1. Get projectId at https://dashboard.reown.comconst projectId = "YOUR_PROJECT_ID";// 2. Create your application's metadata objectconst metadata = { name: "My Website", description: "My Website description", url: "https://mywebsite.com", // url must match your domain & subdomain icons: ["https://avatars.mywebsite.com/"],};// 3. Create a AppKit instanceconst modal = createAppKit({ adapters: [new Ethers5Adapter()], metadata: metadata, networks: [mainnet, arbitrum], projectId, features: { analytics: true, // Optional - defaults to your Cloud configuration },});
Make sure that the url from the metadata matches your domain and subdomain. This will later be used by the Verify API to tell wallets if your application has been verified or not.
ethers Example
Check the JavaScript ethers example
In your main.js file set up the following configuration.
import { createAppKit } from "@reown/appkit";import { EthersAdapter } from "@reown/appkit-adapter-ethers";import { mainnet, arbitrum } from "@reown/appkit/networks";// 1. Get projectId from https://dashboard.reown.comconst projectId = "YOUR_PROJECT_ID";// 2. Create your application's metadata objectconst metadata = { name: "AppKit", description: "AppKit Example", url: "https://reown.com/appkit", // origin must match your domain & subdomain icons: ["https://avatars.githubusercontent.com/u/179229932"],};// 3. Create a AppKit instanceconst modal = createAppKit({ adapters: [new EthersAdapter()], networks: [mainnet, arbitrum], metadata, projectId, features: { analytics: true, // Optional - defaults to your Cloud configuration },});
Make sure that the url from the metadata matches your domain and subdomain. This will later be used by the Verify API to tell wallets if your application has been verified or not.
MetaMask does not currently support WalletConnect connections on Solana. The MetaMask team is working on adding this feature. In the meantime, we recommend using other wallets that support Solana. You can find the complete list of supported wallets on WalletGuide.
Solana Example
Check the JavaScript Solana example
AppKit Solana is built on top of the AppKit library and provides a set of components and actions to easily connect Solana wallets with your application.On top of your app set up the following configuration.
import { createAppKit } from "@reown/appkit";import { SolanaAdapter } from "@reown/appkit-adapter-solana";import { solana, solanaTestnet, solanaDevnet } from "@reown/appkit/networks";// 0. Set up Solana Adapterconst solanaWeb3JsAdapter = new SolanaAdapter();// 1. Get projectId from https://dashboard.reown.comconst projectId = "YOUR_PROJECT_ID";// 2. Create a metadata object - optionalconst metadata = { name: "AppKit", description: "AppKit Solana Example", url: "https://example.com", // origin must match your domain & subdomain icons: ["https://avatars.githubusercontent.com/u/179229932"],};// 3. Create modalcreateAppKit({ adapters: [solanaWeb3JsAdapter], networks: [solana, solanaTestnet, solanaDevnet], metadata: metadata, projectId, features: { analytics: true, // Optional - defaults to your Cloud configuration },});
Bitcoin Example
Check the JavaScript Bitcoin example
AppKit Bitcoin is built on top of the AppKit library and provides a set of components and actions to easily connect Bitcoin wallets with your decentralized application.On top of your app set up the following configuration.
// App.tsximport { createAppKit } from '@reown/appkit'import { BitcoinAdapter } from '@reown/appkit-adapter-bitcoin'import { bitcoin, bitcoinTestnet, bitcoinSignet } from '@reown/appkit/networks'// 1. Get projectId from https://dashboard.reown.comconst projectId = 'YOUR_PROJECT_ID'// 2. Set the networksconst networks = [bitcoin, bitcoinTestnet, bitcoinSignet]// 3. Set up Bitcoin Adapterconst bitcoinAdapter = new BitcoinAdapter({ projectId})// 4. Create a metadata object - optionalconst metadata = { name: 'AppKit', description: 'AppKit Bitcoin Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932']}// 5. Create modalconst modal = createAppKit({ adapters: [bitcoinAdapter], networks, metadata, projectId, features: { analytics: true // Optional - defaults to your Dashboard configuration, email: false, socials: [] }})// 6. Trigger modal programaticalyconst openConnectModalBtn = document.getElementById('open-connect-modal')const openNetworkModalBtn = document.getElementById('open-network-modal')openConnectModalBtn.addEventListener('click', () => modal.open())openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))
export type SignMessageParams = { /** * The message to be signed */ message: string /** * The address to sign the message with */ address: string }
export type SendTransferParams = { /** * The amount to be sent in satoshis */ amount: string /** * The address to send the transfer to */ recipient: string }
export type SignPSBTParams = { /** * The PSBT to be signed, string base64 encoded */ psbt: string signInputs: { /** * The address whose private key to use for signing. */ address: string /** * Specifies which input to sign */ index: number /** * Specifies which part(s) of the transaction the signature commits to */ sighashTypes: number[] }[] /** * If `true`, the PSBT will be broadcasted after signing. Default is `false`. */ broadcast?: boolean}
export type AccountAddress = { /** * Public address belonging to the account. */ address: string /** * Public key for the derivation path in hex, without 0x prefix */ publicKey?: string /** * The derivation path of the address e.g. "m/84'/0'/0'/0/0" */ path?: string /** * The purpose of the address */ purpose: 'payment' | 'ordinal' | 'stx' }
export type SignPSBTResponse = { /** * The signed PSBT, string base64 encoded */ psbt: string /** * The `string` transaction id of the broadcasted transaction or `undefined` if not broadcasted */ txid?: string }
TON Example
Check the JavaScript TON example
AppKit TON is built on top of the AppKit library and provides a set of components and actions to easily connect TON wallets with your decentralized application.On top of your app set up the following configuration.
// App.tsximport { createAppKit } from '@reown/appkit'import { TonAdapter } from '@reown/appkit-adapter-ton'import { ton, tonTestnet } from '@reown/appkit/networks'// 1. Get projectId from https://dashboard.reown.comconst projectId = 'YOUR_PROJECT_ID'// 2. Set the networksconst networks = [ton, tonTestnet]// 3. Set up TON Adapterconst tonAdapter = new TonAdapter({ projectId})// 4. Create a metadata object - optionalconst metadata = { name: 'AppKit', description: 'AppKit TON Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932']}// 5. Create modalconst modal = createAppKit({ adapters: [tonAdapter], networks, metadata, projectId, features: { analytics: true // Optional - defaults to your Dashboard configuration, email: false, socials: [] }})// 6. Trigger modal programmaticallyconst openConnectModalBtn = document.getElementById('open-connect-modal')const openNetworkModalBtn = document.getElementById('open-network-modal')openConnectModalBtn.addEventListener('click', () => modal.open())openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))
AppKit TRON is built on top of the AppKit library and provides a set of components and actions to easily connect TRON wallets with your decentralized application.On top of your app set up the following configuration.
// App.tsximport { createAppKit } from '@reown/appkit'import { TronAdapter } from '@reown/appkit-adapter-tron'import { tronMainnet, tronShastaTestnet } from '@reown/appkit/networks'// Import wallet adapters you want to supportimport { TronLinkAdapter } from '@tronweb3/tronwallet-adapter-tronlink'// 1. Get projectId from https://dashboard.reown.comconst projectId = 'YOUR_PROJECT_ID'// 2. Set the networksconst networks = [tronMainnet, tronShastaTestnet]// 3. Set up TRON Adapter with wallet adaptersconst tronAdapter = new TronAdapter({ walletAdapters: [ new TronLinkAdapter({ openUrlWhenWalletNotFound: false, checkTimeout: 3000 }) ]})// 4. Create a metadata object - optionalconst metadata = { name: 'AppKit', description: 'AppKit TRON Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932']}// 5. Create modalconst modal = createAppKit({ adapters: [tronAdapter], networks, metadata, projectId, features: { analytics: true, // Optional - defaults to your Dashboard configuration email: false, socials: [] }})// 6. Trigger modal programaticalyconst openConnectModalBtn = document.getElementById('open-connect-modal')const openNetworkModalBtn = document.getElementById('open-network-modal')openConnectModalBtn.addEventListener('click', () => modal.open())openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))
After installing your desired wallet adapters, import and add them to the walletAdapters array when creating the TRON adapter:
import { TronLinkAdapter } from '@tronweb3/tronwallet-adapter-tronlink'import { MetaMaskAdapter } from '@tronweb3/tronwallet-adapter-metamask-tron'import { TrustAdapter } from '@tronweb3/tronwallet-adapter-trust'import { OkxWalletAdapter } from '@tronweb3/tronwallet-adapter-okxwallet'const tronAdapter = new TronAdapter({ walletAdapters: [ new TronLinkAdapter({ openUrlWhenWalletNotFound: false, checkTimeout: 3000 }), new MetaMaskAdapter(), new TrustAdapter(), new OkxWalletAdapter({ openUrlWhenWalletNotFound: false }) ]})
AppKit Core Example
Check the JavaScript AppKit Core example for Sui and Stacks
For a quick integration of Appkit Core you can use the UniversalConnector class. Which simplifies the integration of Appkit Core by providing a single interface for all the blockchain protocols.You can configure the Universal Connector with the networks you want to support.
For more information, please visit RPC Reference section from our docs.We recommend creating a config file to establish a singleton instance for the Universal Connector:
import { UniversalConnector } from '@reown/appkit-universal-connector'export const projectId = import.meta.env.VITE_PROJECT_ID || "b56e18d47c72ab683b10814fe9495694" // this is a public projectId only to use on localhostif (!projectId) { throw new Error('Project ID is not defined')}// you can configure your own networkconst suiMainnet = { id: 784, chainNamespace: 'sui', caipNetworkId: 'sui:mainnet', name: 'Sui', nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 }, rpcUrls: { default: { http: ['https://fullnode.mainnet.sui.io:443'] } }}const stacksMainnet = { id: 1, chainNamespace: 'stacks', caipNetworkId: 'stacks:1', name: 'Stacks', nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 }, rpcUrls: { default: { http: ['https://stacks-node-mainnet.stacks.co'] } }}export const networks = [suiMainnet, stacksMainnet]export let universalConnectorexport async function getUniversalConnector() { if (!universalConnector) { universalConnector = await UniversalConnector.init({ projectId, metadata: { name: 'Universal Connector', description: 'Universal Connector', url: 'https://appkit.reown.com', icons: ['https://appkit.reown.com/icon.png'] }, networks: [ { methods: ['sui_signPersonalMessage'], chains: [suiMainnet], events: [], namespace: 'sui' }, { methods: ['stx_signMessage'], chains: [stacksMainnet], events: ['stx_chainChanged'], namespace: 'stacks' } ] }) } return universalConnector}
In de main.js file you can add :
import { getUniversalConnector } from './config/appKit.js'async function setup() { const universalConnector = await getUniversalConnector() // check if session is already connected if (universalConnector?.provider.session) { session = universalConnector?.provider.session }}setup()
You need to install @wagmi/core to interact with smart contracts:
npm install @wagmi/core
Wagmi actions can help us interact with wallets and smart contracts:For this use case, we need to import the wagmiConfigfrom our AppKit WagmiAdapter configuration.
import { readContract } from '@wagmi/core'import { USDTAbi } from '../abi/USDTAbi'const USDTAddress = '0x...'const data = readContract(wagmiConfig, { address: USDTAddress, abi: USDTAbi, functionName: 'totalSupply', args: []})
Read more about Wagmi actions for smart contract interaction here.
Ethers can help us interact with wallets and smart contracts:
@Solana/web3.js library allows for seamless interaction with wallets and smart contracts on the Solana blockchain.For a practical example of how it works, you can refer to our lab dApp.
import { PublicKey, LAMPORTS_PER_SOL, Transaction, SystemProgram } from "@solana/web3.js";import type { Provider } from '@reown/appkit-adapter-solana'const solanaProvider = {};const solanaConnection = {};modal.subscribeProviders(state => { solanaProvider = state['solana']; const url = solanaProvider.getActiveChain().rpcUrls.default.http[0]; const solanaConnection = new Connection(url);})const addressFrom = await modal.subscribeAccount(state => { return state;})const sendTransaction = async () => { if (!addressFrom || !solanaConnection) throw Error('user is disconnected'); const wallet = new PublicKey(addressFrom); if (!wallet) throw Error('wallet provider is not available'); const latestBlockhash = await solanaConnection.getLatestBlockhash(); const transaction = new Transaction({ feePayer: wallet, recentBlockhash: latestBlockhash?.blockhash, }).add( SystemProgram.transfer({ fromPubkey: wallet, toPubkey: new PublicKey(address), // destination address lamports: 1000, }) ); return await provider.sendTransaction(transaction, solanaConnection);}const getBalance = async () => { if (!addressFrom || !solanaConnection) throw Error('user is disconnected'); const wallet = new PublicKey(addressFrom); const balance = await solanaConnection?.getBalance(wallet); if (balance !== undefined) { return `${balance / LAMPORTS_PER_SOL}`; } else { return '-'; }}
If you are starting from scratch, you can use the following methods to set up your project with Reown AppKit.
AppKit Skills
AppKit Skills provide AI-powered assistance for building with Reown AppKit. Once installed, your AI coding assistant can help you set up, build, and debug your AppKit integration.To install AppKit Skills, run the following command in your terminal:
After installation, you can ask your AI assistant for help with AppKit setup, implementation, and troubleshooting.
AppKit CLI
Reown offers a dedicated CLI to set up a minimal version of AppKit in the easiest and quickest way possible.To do this, please run the command below.
npx @reown/appkit-cli
After running the command, you will be prompted to confirm the installation of the CLI. Upon your confirmation, the CLI will request the following details:
Project Name: Enter the name for your project.
Framework: Select your preferred framework or library. Currently, you have three options: React, Next.js, and Vue.
Network-Specific libraries: Choose whether you want to install Wagmi, Ethers, Solana, or Multichain (EVM + Solana).
After providing the project name and selecting your preferences, the CLI will install a minimal example of AppKit with your preferred blockchain library. The example will be pre-configured with a projectId that will only work on localhost.To fully configure your project, please obtain a projectId from the Reown Dashboard and update your project accordingly.Refer to this section for more information.