Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeReact

Installation

Install @ensforge/react with the ensforge SDK and its peer dependencies in a React 19 app, then check that the install works.

@ensforge/react needs React 19 and the ensforge SDK. It depends on @effect/atom-react and installs it for you. Add @effect/atom-react to your own dependencies only when your code imports from it, such as RegistryContext for the atom layer. Use the version @ensforge/react depends on, so both share one registry context.

Install the packages

npm install @ensforge/react @ensforge/sdk effect viem react
  • @ensforge/sdk is the client the hooks run actions with. See Create a client.
  • effect and viem are peer dependencies, as they are for the SDK.
  • scheduler (0.25 to 0.28) is a peer dependency too. React DOM depends on it. If your package manager reports it missing, add it.
  • react must be version 19 or newer.

Use wagmi? Add the adapter

If your app already has a wagmi config, you do not need a separate wallet setup. Ensforge.fromWagmi from @ensforge/sdk/wagmi builds the client from it. wagmi 2 and 3 work. See Use with wagmi.

What each entry point holds

ImportHolds
@ensforge/reactEnsforgeProvider, every hook, ReadErrorResetBoundary, HydrationBoundary.
@ensforge/react/serverprefetch and dehydrate for server rendering (unstable).
@ensforge/react/atomsThe atom layer the hooks are built on (unstable).

The package is ESM only. Add "use client" to a component file that uses a hook when your framework has server components, as in the Next.js App Router.

Check the install

Render useAddress({ name: "nick.eth" }) under a provider. The Quick start walks through it.

Was this page helpful?