Installation
Install Wyllet and its peer dependencies, and enable WalletConnect.
Install the wyllet package together with its peer dependencies. If your dApp already uses wagmi, you likely have most of them.
Install
pnpm add wyllet wagmi viem @tanstack/react-querynpm install wyllet wagmi viem @tanstack/react-queryyarn add wyllet wagmi viem @tanstack/react-querybun add wyllet wagmi viem @tanstack/react-queryreact and react-dom are peers too. They are already part of any React app.
Peer dependencies
Wyllet has no direct runtime dependencies. Everything it needs is a peer dependency that your dApp provides.
| Package | Version | Required |
|---|---|---|
react | >=18 | Yes |
react-dom | >=18 | Yes |
wagmi | ^3.0.0 | Yes |
viem | ^2.15.0 | Yes |
@tanstack/react-query | >=5.0.0 | Yes |
@walletconnect/ethereum-provider | ^2.21.1 | Only with WalletConnect |
Enable WalletConnect
WalletConnect lets users connect mobile wallets by scanning a QR code on desktop, or by opening the wallet app on a phone. It also powers the All wallets directory. It is optional, and it is only active when you pass a walletConnectProjectId.
To enable it:
- Create a free project ID at cloud.reown.com.
- Install the WalletConnect provider.
- Pass the ID to
getDefaultConfig().
pnpm add @walletconnect/ethereum-providernpm install @walletconnect/ethereum-provideryarn add @walletconnect/ethereum-providerbun add @walletconnect/ethereum-providerimport { base, mainnet } from 'viem/chains'
import { getDefaultConfig } from 'wyllet'
export const config = getDefaultConfig({
appName: 'My dApp',
walletConnectProjectId: 'YOUR_PROJECT_ID',
chains: [mainnet, base],
})Without a project ID, Wyllet does not add a WalletConnect connector, and the WalletConnect option is hidden from the wallet list. Installed browser wallets still work.
Styles
You do not need to import a stylesheet. <WylletProvider> injects its base styles in a <style> element when it renders.
If you would rather serve the base stylesheet as a file, turn injection off and import it yourself:
import 'wyllet/styles.css'<WylletProvider injectStyles={false}>{children}</WylletProvider>TypeScript
Wyllet ships its own type definitions for both ESM and CommonJS. No @types package is needed.
Next steps
- Quick start: render your first connect button.
- Next.js: App Router setup.
- Configuration: every
getDefaultConfig()option.