@txnlab/use-wallet-vue package provides Vue-specific bindings for use-wallet, including a plugin and composables that enable reactive wallet integration in Vue 3 applications.
Installation
- npm
- yarn
- pnpm
Setup
Install the plugin
Install theWalletManagerPlugin when creating your Vue app. This makes the wallet manager available throughout your application.
Using the wallet composable
TheuseWallet composable provides reactive access to wallet state and signing methods.
Basic usage
Return values
TheuseWallet composable returns computed refs and methods:
Wallet interface
Each wallet object has the following properties:Signing transactions
ThetransactionSigner method is compatible with the Algorand SDK’s AtomicTransactionComposer.
Network management
TheuseNetwork composable provides methods for managing network configuration.
Return values
Managing accounts
Switch between accounts for a connected wallet:Signing arbitrary data
For wallets that support it, you can sign arbitrary data for authentication:Options API support
While the Composition API is recommended, you can use the plugin with the Options API:TypeScript support
The package includes full TypeScript definitions. All composables are fully typed:Nuxt integration
For Nuxt applications, create a plugin to initialize the wallet manager:Next steps
Configuration
Learn about wallet and network configuration options
Wallets
Explore supported wallet providers and their options