Installation
This guide walks you through installing the library and its dependencies.Core library
The core library (@txnlab/use-wallet) is framework-agnostic and can be used in any TypeScript/JavaScript project.
The
algosdk package is a peer dependency and must be installed separately.Framework adapters
If you’re using a reactive framework, install the corresponding adapter package instead of (or in addition to) the core library.- React
- Vue
- SolidJS
- Svelte
@txnlab/use-wallet-react.Peer dependencies:- React 17, 18, or 19
- algosdk ^3.0.0
Wallet provider packages
Wallet provider SDKs are optional peer dependencies. Install only the packages for wallets you want to support in your application.Pera Wallet
Defly Wallet
WalletConnect
- @walletconnect/modal ^2.7.0
- @walletconnect/sign-client ^2.23.4
You’ll need a WalletConnect project ID. Get one free at cloud.walletconnect.com.
Lute Wallet
Magic (Email authentication)
- magic-sdk ^29.4.2
- @magic-ext/algorand ^24.4.2
Magic requires an API key. Sign up at magic.link.
Web3Auth
Web3Auth requires a client ID. Register at dashboard.web3auth.io.
Wallet-specific requirements
Exodus
No additional packages required. Exodus uses the AVM Web Provider API.Kibisis
No additional packages required. Kibisis uses the AVM Web Provider API.KMD (Local development)
No additional packages required. KMD connects to a local Algorand node running the Key Management Daemon.Defly Web
No additional packages required. This is the browser extension version of Defly that uses the AVM Web Provider API.Mnemonic
No additional packages required. Allows direct connection via 25-word mnemonic phrase.TypeScript configuration
If you’re using TypeScript, ensure yourtsconfig.json includes:
tsconfig.json
Bundle considerations
Tree shaking
The library is built with ESM support and tree shaking in mind. Only the wallet providers you configure will be included in your bundle.Polyfills
Some wallet SDKs require Node.js polyfills in browser environments. If you encounter build errors related to Node.js modules:- Vite
- Next.js
- Webpack
Install polyfill plugins:Update
vite.config.ts:vite.config.ts
Next steps
Quick start guide
Learn how to set up wallet connections in your application