# getRegistry

Returns indexed metadata for one ENSv2 registry.

## Import

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

## Usage

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

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

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

## Parameters

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

### address

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

Registry contract address. Provide either `address` or `name`.

### name

`string | undefined`

Managed ENS name. Provide either `name` or `address`.

## Return Type

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

When supported, `value` is the indexed registry or `null` when it is not found.

## 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 action in an Effect program. The success and error channels remain
fully typed.

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

const program = getRegistry.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 { GetRegistryError } 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.getRegistry`](/sdk/api/indexer/registries/get-registry)
* [`useIndexedRegistry`](/react/api/hooks/indexer/registries/use-indexed-registry)
