Reown AppKit
Connect to Carbonized with Reown AppKit (WalletConnect) or an injected wallet such as MetaMask.
Carbonized connects wallets through Reown AppKit (formerly WalletConnect Web3Modal) with the wagmi adapter (@reown/appkit, @reown/appkit-adapter-wagmi). Injected browser wallets such as MetaMask also work.
Setup
Create a Reown project
Sign in at https://dashboard.reown.com, create a project of type AppKit / Web, and copy the Project ID.
Allow your origin
In the project's settings add the domains you serve the app from (for example http://localhost:3000 and your production URL). WalletConnect rejects unknown origins.
Set the environment variable
NEXT_PUBLIC_REOWN_PROJECT_ID=<your project id>
NEXT_PUBLIC_APP_URL=http://localhost:3000 # used in AppKit metadataRestart the dev server after editing .env.local.
How the app behaves
How the Connect Wallet button behaves:
NEXT_PUBLIC_REOWN_PROJECT_ID | Connect Wallet button | wagmi config |
|---|---|---|
| set | Opens the AppKit modal (WalletConnect QR, mobile wallets, detected browser wallets) | WagmiAdapter config limited to the target chain |
| unset | Connects directly with the first wagmi connector, injected() (MetaMask and similar) | Plain wagmi config with injected() |
In both modes:
- The target chain comes from
NEXT_PUBLIC_NETWORK(see Networks). AppKit is configured with only that chain, and it is also the default network. - AppKit metadata: name
Carbonized, descriptionDecentralized carbon credit marketplace, icon<NEXT_PUBLIC_APP_URL>/icon.png. Analytics are disabled (features.analytics: false). - When connected on the wrong chain, the button becomes Switch to <chain name>.
- When connected on the right chain, the button shows the shortened address; clicking it disconnects.
Without a Reown project id, only injected wallets can connect. That is enough for local Hardhat development.
Connect step by step
Open /app and click Connect Wallet.
Pick a wallet in the modal (or approve the MetaMask prompt in injected mode).
If the header shows Switch to Robinhood Chain Testnet, click it and approve the network switch in your wallet. If your wallet does not know the chain, add it with the values in Networks.
Fund the account with testnet ETH from https://faucet.testnet.chain.robinhood.com.
Troubleshooting
- Modal does not open /
Connect Walletconnects MetaMask only:NEXT_PUBLIC_REOWN_PROJECT_IDis empty or the server was not restarted. - WalletConnect errors about origin: add the current origin to the project's allowed domains in the Reown dashboard.
- Wrong network: check
NEXT_PUBLIC_NETWORKandNEXT_PUBLIC_CHAIN_IDmatch the chain you deployed to.
More in Troubleshooting.