# getRegistry

Returns indexed metadata for one ENSv2 registry.

## Import

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

## Usage

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

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

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

## Parameters

```ts
import type { GetRegistryParametersType } from "@ensforge/sdk/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/sdk/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 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.getRegistry.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 { GetRegistryError } 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

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

## Hook

* [`useIndexedRegistry`](/react/api/hooks/indexer/registries/use-indexed-registry)
