> **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.

# useHcaRegistration

Inspect/reconcile saved registration. Uses the SDK from `EnsforgeProvider`.

## Import

```tsx
import { useHcaRegistration } from "@ensforge/react";
```

## Usage

:::code-group
```tsx [component.tsx]
import { useHcaRegistration } from "@ensforge/react";

function Component() {
  const result = useHcaRegistration({
    id: "registration-instance-id",
  });

  // The saved operation includes a commitment secret; only render its status.
  return <p>{result.data?.progress.status ?? "Loading registration…"}</p>;
}
```

```tsx [provider.tsx]
// [!include ~/snippets/hca/provider.tsx]
```
:::

## Parameters

```ts
import type { UseEnsAtomParameters } from "@ensforge/react";
import type { GetHcaRegistrationParameters } from "@ensforge/sdk/hca";
```

### id

`string`

Saved operation identifier. Start registration can generate it from matching unfinished work.

### storage

`WorkflowStorage | HcaRegistrationStorage | undefined`

Optional storage override. Defaults to config storage.

### execution

`HcaRegistrationExecution | undefined`

Compatible execution adapter. Omit for direct owner execution when supported.

### enabled

`boolean | undefined`

Defaults to `true`. Set it to `false` to keep the atom idle without executing the action.

### map

`(value: Success) => Mapped | undefined`

Maps successful data for this hook without changing the value stored by the underlying atom.

### atom

`EnsAtomOptions<Failure> | undefined`

Controls the Effect Atom lifecycle for this hook.

| Property          | Type                         | Default       | Description                                     |
| ----------------- | ---------------------------- | ------------- | ----------------------------------------------- |
| `idleTTL`         | `Duration.Input`             | `"5 minutes"` | Retains an unused atom before it is disposed.   |
| `refreshInterval` | `false \| Duration.Input`    | `false`       | Refreshes the atom while it remains subscribed. |
| `retry`           | `false \| Schedule`          | `false`       | Retries typed failures with an Effect schedule. |
| `swr`             | `false \| EnsAtomSwrOptions` | enabled       | Configures stale-while-revalidate behavior.     |

See [Atom Options](/react/api/atom-options) for focused examples.

## Return Type

```ts
type Result = ReturnType<typeof useHcaRegistration>;
```

Returns an [`EnsAtomResult`](/react/api/atom-result).

| Property        | Description                                             |
| --------------- | ------------------------------------------------------- |
| `data`          | Successful action data, or `undefined` before success.  |
| `error`         | Typed action failure, an unexpected `Error`, or `null`. |
| `cause`         | Complete Effect cause for the latest failure.           |
| `isInitial`     | No execution has completed yet.                         |
| `isWaiting`     | Initial or background work is running.                  |
| `isSuccess`     | The atom contains a successful value.                   |
| `isFailure`     | The atom contains a failed result.                      |
| `refresh`       | Refreshes the atom and returns a Promise.               |
| `refreshEffect` | Refreshes with a typed Effect error channel.            |
| `result`        | Underlying Effect `AsyncResult`.                        |
| `updatedAt`     | Timestamp of the latest successful value.               |

## Suspense

Use [`useHcaRegistrationSuspense`](/react/api/hooks/hca/use-hca-registration-suspense) beneath Suspense and an error boundary.

## Effect Atom

```ts
import { getHcaRegistrationAtom } from "@ensforge/react/atoms";
import { sdk } from "./client";

const atom = getHcaRegistrationAtom(sdk, parameters, options);
```

## Action

* [`getHcaRegistration`](/core/api/actions/hca/get-hca-registration)
* [`sdk.hca.getHcaRegistration`](/sdk/api/hca/get-hca-registration)
