Open-source, framework-agnostic JavaScript library to onboard users to web3 apps. Help your users transact with ease by enabling wallet connection, real-time transaction states, and more.
Npm
Yarn
terminal
Copied
Copy
npm i @web3-onboard/core @web3-onboard/injected @web3-onboard/transaction-preview
All wallet dependencies are included in separate packages, so you only include the ones you want to use in your app. Core package is only 815kb minified.
Dynamic Imports
Supporting multiple wallets in your app requires a lot of dependencies. Onboard dynamically imports a wallet and it's dependencies only when the user selects it, so that minimal bandwidth is used.
Wallet Provider Standardization
All wallet modules expose a provider that is patched to be compliant with the EIP-1193, EIP-1102, EIP-3085 and EIP-3326 specifications.
Multiple Chain Support
The best connect wallet button for allowing users to switch between chains/networks with ease.
Enable Multi-Wallet and Multi-Chain functionality with one library
Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain support to your project. With built-in modules for more than 35 unique hardware and software wallets, Web3-Onboard saves you time and headaches.
Preview transactions to see net-balance changes and gas spent
Reduce transaction anxiety by allowing users to easily preview expected net-balance changes for their connected wallets before authorizing transactions.
import Onboard from'@web3-onboard/core'import injectedModule from'@web3-onboard/injected-wallets'import{ethers}from'ethers'const MAINNET_RPC_URL ='https://mainnet.infura.io/v3/<INFURA_KEY>'const injected =injectedModule()const onboard =Onboard({wallets: [injected],chains: [{id:'0x1',token:'ETH',label:'Ethereum Mainnet',rpcUrl: MAINNET_RPC_URL} ]})const wallets =await onboard.connectWallet()console.log(wallets)if (wallets[0]) {// create an ethers provider with the last connected wallet providerconstethersProvider=newethers.providers.Web3Provider(wallets[0].provider,'any')// if using ethers v6 this is:// ethersProvider = new ethers.BrowserProvider(wallet.provider, 'any')constsigner=ethersProvider.getSigner()// send a transaction with the ethers providerconsttxn=awaitsigner.sendTransaction({ to:'0x', value:100000000000000})constreceipt=awaittxn.wait()console.log(receipt)}