# getIndexedName

Returns the normalized indexed state for one ENS name.

## Import

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

## Usage

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

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

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

## Parameters

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

## Return Type

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

Returns `IndexedNameV1 | IndexedNameV2 | null`. Narrow `protocol` before using protocol-specific ownership, wrapping, migration, registration, and registry fields.

## Protocol Sources

ENSv2 is preferred when available, followed by ENSv1. An optional protocol selector on resolver queries disables fallback.

## 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.getIndexedName.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 { GetIndexedNameError } 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

* [`getIndexedName`](/core/api/actions/indexer/names/get-indexed-name)

## Hook

* [`useIndexedName`](/react/api/hooks/indexer/names/use-indexed-name)
