# getRegistrationHistory

Lists registration and renewal history for one ENS name.

## Import

```ts
import { getRegistrationHistory } from "@ensforge/core/indexer";
```

## Usage

:::code-group
```ts [index.ts]
import { getRegistrationHistory } from "@ensforge/core/indexer";
import { config } from "./config";

const result = await getRegistrationHistory(config, {
  name: "example.eth",
  pageSize: 20,
});
```

```ts [config.ts]
// [!include ~/snippets/core/config.ts]
```
:::

## Parameters

```ts
import type { GetRegistrationHistoryParameters } from "@ensforge/core/indexer";
```

### name

`string | undefined`

ENS name to look up. Provide either `name` or `namehash`; names are normalized before querying.

### namehash

`` `0x${string}` | undefined ``

Namehash to use when the plaintext name is unavailable. Provide either `namehash` or `name`.

### pageSize

`number | undefined`

Maximum number of items to return. It must be greater than zero and cannot exceed the
`maximumPageSize` configured for the indexer. The default is the smaller of `20` and the configured
maximum.

### cursor

`IndexerCursor | undefined`

Opaque cursor returned by the previous page. Pass it unchanged to continue the same query. A cursor
is tied to its filters, ordering, network, and enabled indexer sources; changing any of them requires
starting again without a cursor.

## Return Type

```ts
import type { GetRegistrationHistoryResult } from "@ensforge/core/indexer";
```

Items are discriminated by semantic `kind` and contain normalized chain position, protocol, name identity, raw metadata, and kind-specific fields.

The result is an `IndexerPage`:

| Property               | Type                                 | Description                                                         |
| ---------------------- | ------------------------------------ | ------------------------------------------------------------------- |
| `items`                | `readonly Item[]`                    | Normalized results in deterministic cross-protocol order.           |
| `pageInfo.cursor`      | `IndexerCursor \| null`              | Cursor for the next page, or `null` when no continuation is needed. |
| `pageInfo.hasNextPage` | `boolean`                            | Whether another page is available.                                  |
| `sources`              | `readonly IndexerSourcePageStatus[]` | Per-protocol participation, block metadata, and partial failures.   |

Do not inspect or construct cursors. Persist and pass the returned value as-is.

## Protocol Sources

Compatible events from enabled ENSv1 and ENSv2 sources are normalized and merged by chain position.

## Effect

Use `.effect` when composing the action in an Effect program. The success and error channels remain
fully typed.

```ts
import { Effect } from "effect";

const program = getRegistrationHistory.effect(config, parameters);

type Success = Effect.Effect.Success<typeof program>;
type Failure = Effect.Effect.Error<typeof program>;

const result = await Effect.runPromise(program);
```

## Error

```ts
import type { GetRegistrationHistoryError } from "@ensforge/core/indexer";
```

The Promise API rejects with the same typed failures exposed by the Effect error channel. Errors
have a stable `_tag`, `code`, and `message`; boundary errors retain their original `cause`.

See [Error Handling](/core/guides/error-handling).

## Related

* [`sdk.indexer.getRegistrationHistory`](/sdk/api/indexer/history/get-registration-history)
* [`useRegistrationHistory`](/react/api/hooks/indexer/history/use-registration-history)
