Reads, writes and registration for every name
The toolkit forbuilding on ENS.
Resolve, update and register any name with one typed TypeScript API, built on viem.
01Packages
Pick the pieces you need.
Start with the SDK. Add hooks for React, or reach for the ABIs directly. Every package is tree-shakeable, so your app carries only what it calls.
SDK
@ensforge/sdk
The client. Every ENS read and write, for every name, on the viem clients you have.
- Reads, writes and registration
- Typed errors with stable codes
- Batches and multi-step plans
SDK docs
React
@ensforge/react
Hooks for React 19: names, records and writes, cached and ready for the server.
- useAddress, usePrimaryName, …
- Suspense and SSR hydration
- useWrite, step by step
React docs
HCAexperimental
@ensforge/hca
Hosted Contract Accounts: many writes in one execution, sessions and gasless writes.
- Batched writes, one execution
- Sessions for your app
- Bundlers and paymasters
HCA docs
Contracts
@ensforge/contracts
ENS's ABIs, deployment addresses and constants, typed for viem.
- Every ENSv1 and ENSv2 contract
- Mainnet and Sepolia
- No dependency but viem
Contracts docs
How ensforge fits in.
It sits between your code and ENS on Ethereum: one client on viem, actions that know how ENS works, and every name answered the same way.
02Playground
Read ENS from your browser.
Real calls to Ethereum mainnet with @ensforge/sdk. Pick a name, press Run, and see the value, the JSON and the code that fetched it.
ens.name.get + ens.record.get
A name's state, its text records, address and avatar: everything a profile page shows.
Press Run to read nick.eth from mainnet.
Real calls, a public RPC, no wallet.
Code
import { Ensforge, ensActions } from "@ensforge/sdk";
import { mainnet } from "viem/chains";
const ens = Ensforge.create({ chain: mainnet }).extend(ensActions());
const [state, records, avatar] = await Promise.all([
ens.name.get({ name: "nick.eth" }),
ens.record.get({
name: "nick.eth",
texts: ["description", "url", "com.github", "com.twitter", "org.telegram", "com.discord", "email"],
addresses: ["eth"],
}),
ens.record.getAvatar({ name: "nick.eth" }),
]);Output
not run yet
// The response appears here, bigints as strings.
Reads Ethereum mainnet through rpc.namespace.ninja · results cached for this visit
Start here
Read your first ENS name.
Install the SDK, create a client from your viem client and read nick.eth. It takes five minutes and no wallet. Every other name works the same way.