Tevm examples that run against what npm actually serves.
Six standalone apps — Bun, esbuild, Vite, Next.js, SvelteKit, and MUD — each installing Tevm from the published registry with zero workspace links. Copy any of them as a starting point, or treat the repo as what it also is: Tevm's end-to-end integration smoke test.
git clone https://github.com/evmts/tevm-examples.git && cd tevm-examples && pnpm installPick a stack
Bun runtime with the Tevm Bun plugin: import a .sol file, fork mainnet, and read a contract with createMemoryClient.
pnpm dlx degit evmts/tevm-examples/apps/bun my-appesbuild bundling with the Tevm esbuild plugin and a viem public client reading from a forked memory client.
pnpm dlx degit evmts/tevm-examples/apps/esbuild my-appVite + React + Wagmi + Ethers with a Foundry project and in-browser solc — the full frontend stack.
pnpm dlx degit evmts/tevm-examples/apps/vite my-appNext.js app router running an in-browser Tevm memory client — no backend RPC required.
pnpm dlx degit evmts/tevm-examples/apps/next my-appSvelteKit wired to Tevm through the @tevm/ethers adapter — Tevm behind a familiar ethers.js interface.
pnpm dlx degit evmts/tevm-examples/apps/svelte-ethers my-appA React MUD application — onchain state synced to the client with Tevm underneath.
pnpm dlx degit evmts/tevm-examples/apps/mud my-appimport { http } from '@tevm/jsonrpc'
import { ERC20 } from 'tevm/contract'
import { createMemoryClient } from 'tevm/memory-client'
// Fork a live chain into an in-memory EVM
const client = createMemoryClient({
fork: { transport: http(process.env.RPC_URL ?? 'http://localhost:8545') },
})
// Read real chain state with full type safety — nothing to mock
const balance = await client.readContract({
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
abi: ERC20.abi,
functionName: 'balanceOf',
args: ['0x55FE002aefF02F77364de339a1292923A15844B8'],
})
console.log(balance) // 310145594603826337866nPublished packages only
Every app installs @tevm/* from npm — no workspace links, no monorepo internals. If it runs here, it runs for you.
npm install @tevm/contract
Six toolchains
Bun, esbuild, Vite, Next.js, SvelteKit, and MUD — the same Tevm APIs working across runtimes and bundlers.
apps/{bun,esbuild,vite,next,svelte-ethers,mud}
Solidity imports everywhere
Import .sol files straight into TypeScript with fully typed contract objects via the Tevm bundler plugins.
import { Counter } from './Counter.sol'
A real smoke test
pnpm build && pnpm test in this repo is an end-to-end check that a Tevm release installs, types, bundles, and runs.
pnpm build && pnpm test
Fork mainnet locally
The examples fork Ethereum mainnet into an in-memory EVM — read real state without an archive node.
createMemoryClient({ fork: { url } })
Copy-paste starting points
Each app is a normal project. Clone the repo, or scaffold a single app with degit and start hacking.
pnpm dlx degit evmts/tevm-examples/apps/vite my-app
Tevm Examples
evmts/tevm-examples is the home of every standalone Tevm example application.
Each app in apps/ is a normal application that installs
Tevm from npm — there are no workspace links back to the Tevm source tree. That single constraint is the whole
point of this repository:
- Examples that actually work. Copying a snippet out of these apps gives you code that runs against the packages npm serves you today, not against unreleased monorepo internals.
- An integration smoke test. Because the apps resolve published versions,
pnpm build && pnpm testhere is a real end-to-end check that a Tevm release installs, type-checks, bundles, and runs across six different toolchains.
The applications
| App | What it demonstrates |
|---|---|
apps/bun | Bun runtime, @tevm/bun-plugin, Solidity imports, forked createMemoryClient |
apps/esbuild | esbuild bundling with @tevm/esbuild-plugin and a viem public client |
apps/vite | Vite + React + Wagmi + Ethers, Foundry project, in-browser solc |
apps/next | Next.js app router with an in-browser Tevm memory client |
apps/svelte-ethers | SvelteKit with the @tevm/ethers adapter |
apps/mud | A React MUD application |
Start here
- Getting started — clone, install, and run the workspace.
- Solidity imports — the feature almost every app depends on.
- How this repo relates to Tevm — where core, docs, and examples live.
Where the rest of the docs live
This site documents the examples. API documentation for Tevm itself lives at tevm.sh, and the Tevm Node docs live at node.tevm.sh.
Part of the tevm.sh family
Each Tevm project has its own docs site, built on the same design system:

