> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# React integration

Use the existing `EnsforgeProvider`. No HCA-specific provider or second SDK is required. When creating an SDK from config, it defaults to lazy IndexedDB storage. Supply `storage` to override
that default, or pass an existing SDK to preserve its storage. Use a compatible adapter for the selected chain/account.
The provider retains its initial SDK/config; deliberately remount it when changing that configuration.
Wagmi-backed configurations continue to resolve the active wallet through Wagmi.

```tsx
import { useHca, useStartHcaRegistration } from "@ensforge/react";

function Account({ hca }) {
  const account = useHca({ hca });
  const registration = useStartHcaRegistration();
  // Invoke registration.mutate(input) only in an explicit user event.
  return <p>{account.isWaiting ? "Loading account" : "Account loaded"}</p>;
}
```

See the fully typed [browser example](/hca/guides/storage) for registration controls and IndexedDB recovery.
It is source code for your application, not an embedded write playground.

## Reads and mutations

Named read hooks cover account identity, owner, implementation, capability checks, nonce, deposit,
signature validation, modules, upgrade eligibility, session state, registration and execution status.
Each selected HCA query also has a `Suspense` variant. Read hooks use the same `enabled`, `map`, `atom`
cache/retry/refresh controls as other ENS hooks.

Mutations include deployment, call preparation/execution, execution waiting, enabling/revoking sessions,
starting/resuming/cancelling registration, deposits, withdrawals and upgrades. `mutate` dispatches from
an event; `mutateAsync` returns a promise; `mutateEffect` composes in Effect. Observe `data`, `error`,
`isWaiting` and `result`. Lifecycle callbacks use `onExit`, not `onSuccess`.

`useWorkflow`, `useWorkflows` and `useReconcileWorkflowSubmission` expose persisted normal workflows.
`useHcaRegistration` reconciles the HCA registration operation; its result contains a secret and must
not be logged or rendered wholesale. For server-owned registration use the redacted remote actions.

## Provider extensions

```tsx
const mutation = useEnsMutation(remote.resumeRegistration);
const query = useEnsQuery(remote.getRegistration, { id, enabled: Boolean(id) });
```

Generic bindings accept unbound Ensforge actions such as remote registration and Rhinestone funding.
Construct adapters/action collections outside render or memoize them using stable configuration.
Core never imports provider packages, and the browser should import only the provider it uses.

## Cancellation is explicit

| UI control                 | Effect                                            |
| -------------------------- | ------------------------------------------------- |
| `interrupt()`              | Stops local mutation work/waiting                 |
| `useCancelHcaRegistration` | Cancels eligible local registration progression   |
| Rhinestone `cancelFunding` | Cancels eligible source funding before submission |
| `useRevokeHcaSessions`     | Sends destination session revocation              |
| `reset()`                  | Clears local mutation UI state                    |

None of these controls means an already broadcast transaction was undone. Display pending/unknown
states and keep tracking identifiers available. Do not enable an automatic retry policy for mutations
unless that action's recovery semantics make retrying safe.

## Provider walkthroughs

Follow [Execute with Pimlico](/hca/pimlico/getting-started) for owner UserOperations,
[Rhinestone Sessions](/hca/rhinestone/getting-started) for sponsored session calls, and
[Cross-chain Funding](/hca/rhinestone/cross-chain) for independent destination funding. The walkthroughs use SDK
actions; the same adapter is accepted by the corresponding core actions and React hooks.
