clawchain/wagmi/site/core/installation.md

1.4 KiB

Installation

Install Wagmi Core via your package manager, a <script> tag, or build from source.

Package Manager

Install the required packages.

::: code-group

pnpm add @wagmi/core viem@{{viemVersion}}
npm install @wagmi/core viem@{{viemVersion}}
yarn add @wagmi/core viem@{{viemVersion}}
bun add @wagmi/core viem@{{viemVersion}}

:::

  • 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'
  import { createConfig } from 'https://esm.sh/@wagmi/core@{{viemVersion}}'
  import { injected } from 'https://esm.sh/@wagmi/connectors'
</script>