Installation ​
Install Wagmi Core via your package manager, a <script>
tag, or build from source.
Package Manager ​
Install the required packages.
pnpm add @wagmi/core@rc viem@2.0.0-rc.0
pnpm add @wagmi/core@rc viem@2.0.0-rc.0
npm install @wagmi/core@rc viem@2.0.0-rc.0
npm install @wagmi/core@rc viem@2.0.0-rc.0
yarn add @wagmi/core@rc viem@2.0.0-rc.0
yarn add @wagmi/core@rc viem@2.0.0-rc.0
bun add @wagmi/core@rc viem@2.0.0-rc.0
bun add @wagmi/core@rc viem@2.0.0-rc.0
- Viem is a TypeScript interface for Ethereum that performs blockchain operations.
- TypeScript is optional, but highly recommended. Learn more about TypeScript support.
CDN ​
If you're not using a package manager, you can also use Wagmi Core via an ESM-compatible CDN such as esm.sh. Simply add a <script type="module">
tag to the bottom of your HTML file with the following content.
<script type="module">
import { createClient } from 'https://esm.sh/viem@rc'
import { createConfig } from 'https://esm.sh/@wagmi/core@2.0.0-rc.0'
import { injected } from 'https://esm.sh/@wagmi/connectors@rc'
</script>
<script type="module">
import { createClient } from 'https://esm.sh/viem@rc'
import { createConfig } from 'https://esm.sh/@wagmi/core@2.0.0-rc.0'
import { injected } from 'https://esm.sh/@wagmi/connectors@rc'
</script>
Check out the React docs for info on how to use React without JSX.
Requirements ​
Wagmi Core is optimized for modern browsers. It is compatible with the following browsers.
- Chrome 64+
- Edge 79+
- Firefox 67+
- Opera 51+
- Safari 12+
TIP
Depending on your environment, you might need to add polyfills. See Viem Platform Compatibility for more info.
Using Unreleased Commits ​
If you can't wait for a new release to test the latest features, you can either install from the canary
tag (tracks the main
branch).
pnpm add @wagmi/core@canary
pnpm add @wagmi/core@canary
npm install @wagmi/core@canary
npm install @wagmi/core@canary
yarn add @wagmi/core@canary
yarn add @wagmi/core@canary
bun add @wagmi/core@canary
bun add @wagmi/core@canary
Or clone the Wagmi repo to your local machine, build, and link it yourself.
gh repo clone wevm/wagmi
cd wagmi
pnpm install
pnpm build
cd packages/core
pnpm link --global
gh repo clone wevm/wagmi
cd wagmi
pnpm install
pnpm build
cd packages/core
pnpm link --global
Then go to the project where you are using Wagmi and run pnpm link --global @wagmi/core
(or the package manager that you used to link Wagmi globally). Make sure you installed the required peer dependencies and their versions are correct.