Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

wagmi

React hooks library for Ethereum interactions and wallet connections.

Crypto and web3NPM

GitHubWebsite

1. License

License from npm.

github.com/wevm/wagmi

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What wagmi does

wagmi wraps Viem's blockchain calls in React Hooks and routes them through TanStack Query, so the chains in your config and your contract ABIs become TypeScript types and repeated RPC reads are cached and deduplicated.

wagmi popularity

67 / 100
Gid Score, #576 overall
1.8M
downloads a week, npm
6,770
GitHub stars
18
agent projects use it
wagmi: downloads per weeknpm, wagmi 1,756,282
wagmi: GitHub starswevm/wagmi 6,770

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How wagmi is used

  • wagmi is a dependency in 18 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 778 projects, and what it is used with below comes from all of them.
  • The most used alternative in our scan is viem (47 projects).
  • Projects that use it most often also use viem (98.5%), TanStack Query (77.8%), React (91.4%).

By coding agent

10 projects, 0.4%
8 projects, 0.2%
6 projects, 0.2%

Often used with

In 98.5% of its projects
In 77.8% of its projects
In 91.4% of its projects
In 62.9% of its projects
In 41.0% of its projects
In 71.9% of its projects
In 36.1% of its projects
In 71.5% of its projects

wagmi in practice

Strengths

Types inferred from your ABI

The maintainers write that you "often just need to provide an ABI". wagmi then gives you autocomplete, type inference and static validation, so type errors surface before users hit them.

chainId limited to the chains you configured

You can register your config with a <code>declare module 'wagmi'</code> block or pass it through a hook's config property. After that, <code>useBlockNumber</code> only accepts the IDs of the configured chains. In the docs example, <code>chainId: 123</code> is a type error because only Mainnet and Sepolia are set up.

Reads go through TanStack Query

The Why page warns that careless fetching can "cost thousands in RPC compute units." wagmi's answer is TanStack Query, which brings caching, deduplication and persistence.

Data refreshes when wallet, block or network change

The comparison page on wagmi's docs site lists two more pros for wagmi: auto-refresh on wallet, block and network changes, and multicall support.

Watch out for

More verbose at first, by design

The maintainers say the APIs "might seem more verbose at first." They present this as the price of small building blocks that are easy to move, change and remove.

Nested providers before the first hook

Setup does not stop at installing wagmi. You also install Viem and TanStack Query, then nest a <code>QueryClientProvider</code> with its own <code>QueryClient</code> inside <code>WagmiProvider</code>.

Fewer built-in connectors than web3-react

The comparison page on wagmi's docs site lists one con for wagmi: it has fewer built-in connectors than web3-react. The page says it aims to be unbiased and invites readers to suggest changes.

More about wagmi

Funding
  • GitHub Sponsors: https://github.com/wevm
  • Own page: https://drips.network/wevm.eth
  • 16 GitHub sponsors

See all

Packages around it
  • viem: Ethereum interface wagmi runs on
  • @tanstack/react-query: Caching and request layer
  • react: UI library for the hooks
  • @rainbow-me: Wallet connect UI
  • next: React framework
  • ethers: Ethereum library, adapters in docs
More in Crypto and web3

Alternatives

wagmi This page

MITGid 671.8M/wk

viem

TypeScript interface for Ethereum with type-safe interactions.

MITGid 7310.7M/wk

Compare wagmi with another tool

Get started

Install it.

npm install wagmi

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## wagmi
- Install the peers explicitly: `wagmi viem@2.x @tanstack/react-query`. For new projects, the docs recommend `create wagmi` instead.
- Build the config with `createConfig`, and give every chain in `chains` a matching entry in `transports` (for example `[mainnet.id]: http()`).
- Wrap the app in `WagmiProvider`, then put `QueryClientProvider` with a `new QueryClient()` inside it. Hooks only work in components under both providers.
- Register the config (`declare module 'wagmi' { interface Register { config: typeof config } }`) or pass the hook config property, so that `chainId` is typed to the configured chains.
- In query hooks such as `useEnsName`, handle the `status` values `'pending'` and `'error'` before you render `data`.
- Check the installed major version. 2.x docs live at 2.x.wagmi.sh, and there are migration guides for v1 to v2 and v2 to v3.
- For Markdown docs written for language models, read `https://wagmi.sh/llms.txt` or `/llms-full.txt`.