# getRegistryLabels

Lists ENSv2 names managed by or referring to a registry.

## Import

```ts
import { Ensforge } from "@ensforge/sdk";
```

## Usage

:::code-group
```ts [index.ts]
import { sdk } from "./client";

const result = await sdk.indexer.getRegistryLabels({
  address: "0x0000000000000000000000000000000000000000",
  relationship: "label",
  pageSize: 20,
});
```

```ts [client.ts]
// [!include ~/snippets/sdk/client.ts]
```
:::

## Parameters

```ts
import type { GetRegistryLabelsParametersType } from "@ensforge/sdk/indexer";
```

### address

`0x${string}`

Registry contract address.

### relationship

`"label" | "referenced-by" | undefined`

Selects directly managed labels, names referring to the registry, or both when omitted.

### 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 { GetRegistryLabelsResultType } from "@ensforge/sdk/indexer";
```

When supported, each item contains its relationship and normalized ENSv2 name.

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

This operation depends on the ENSv2 indexer and returns a discriminated union:

* `{ status: "supported", value }` when a V2 indexer is configured and available.
* `{ status: "unsupported", network, reason }` when V2 discovery is disabled or unavailable.

Check `status` before reading `value`. An unavailable V2 source is represented as data rather than
an exception so applications can keep supporting networks that only expose ENSv1 indexing.

## Effect

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

```ts
import { Effect } from "effect";
import { sdk } from "./client";

const program = sdk.indexer.getRegistryLabels.effect(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 { GetRegistryLabelsError } from "@ensforge/sdk/indexer";
```

The method rejects with the corresponding Core action errors. Use `.effect` to keep those failures
in the typed Effect error channel.

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

## Action

* [`getRegistryLabels`](/core/api/actions/indexer/registries/get-registry-labels)

## Hook

* [`useRegistryLabels`](/react/api/hooks/indexer/registries/use-registry-labels)
