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/sdkis the client the hooks run actions with. See Create a client.effectandviemare 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.reactmust 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
| Import | Holds |
|---|---|
@ensforge/react | EnsforgeProvider, every hook, ReadErrorResetBoundary, HydrationBoundary. |
@ensforge/react/server | prefetch and dehydrate for server rendering (unstable). |
@ensforge/react/atoms | The 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?