# wagmi — card for AI agents

React hooks library for Ethereum interactions and wallet connections.

Category: Crypto and web3 · npm package `wagmi` · latest version 3.7.9 (checked 2026-11-01)
Install: `npm install wagmi`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (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`.

## Docs written for agents
- [llms.txt (index of the docs)](https://wagmi.sh/llms.txt)

## What it is
- The docs describe wagmi as "a React Hooks library for Ethereum." The repository's tagline is "Reactive primitives for Ethereum apps". The repository was created in November 2021 and is MIT licensed. Its hooks cover accounts, wallets, contracts, transactions, signing and ENS.
- Manual setup takes three packages: `wagmi`, `viem@2.x` and `@tanstack/react-query`. You build a config with `createConfig` that lists your chains and gives each one a transport. Then you wrap the app in `WagmiProvider` and, inside it, a TanStack Query `QueryClientProvider`. Any component under both providers can call the hooks. Viem performs the blockchain operations, and TanStack Query handles requests and caching.
- React is the main target, but the site says the core does not depend on it: "Don't use React, Vue, Solid? Use VanillaJS or build an adapter for your favorite framework." The `create-wagmi` CLI scaffolds a TypeScript project and asks you to choose React or Vanilla.

## Caveats
- 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 `QueryClientProvider` with its own `QueryClient` inside `WagmiProvider`.
- 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.
- Two major versions with separate docs: The main site sends 2.x readers to a separate site, 2.x.wagmi.sh. The docs index has migration guides from v1 to v2 and from v2 to v3, so check which major version your code targets.

## Numbers (AgentGid data)
- Gid Score: 66.6 (#576 of all tools, 6 of 155 in its category)
- Used in 18 public projects set up for AI coding agents (0.3%)
- Downloads last week: 1,756,282 (as of 2026-11-24), +52.3% over 4 weeks
- GitHub stars: 6,770 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
viem 98.5%, TanStack Query 77.8%, React 91.4%, Next.js 62.9%, RainbowKit 41.0%, Tailwind CSS 71.9%

## Checked alternatives (same job)
- viem: https://agentgid.com/tools/viem/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/wagmi/
- Homepage: https://github.com/wevm/wagmi#readme
- Repository: https://github.com/wevm/wagmi
- Source: https://github.com/wevm/wagmi
- Source: https://github.com/wevm/wagmi/releases
- Source: https://wagmi.sh
- Source: https://wagmi.sh/llms.txt
- Source: https://wagmi.sh/react/why.md
- Source: https://wagmi.sh/react/getting-started.md
- Source: https://wagmi.sh/react/comparisons.md

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
