# ENSRainbow Typescript Client SDK

ENSRainbow provides an official TypeScript client SDK to simplify integrations with the API. You can find the SDK package at [@ensnode/ensrainbow-sdk](https://github.com/namehash/ensnode/tree/main/packages/ensrainbow-sdk).

The SDK provides a simple, type-safe interface for all API endpoints and handles proper formatting of labelhashes and error handling.

[@ensnode/ensrainbow-sdk](https://github.com/namehash/ensnode/tree/main/packages/ensrainbow-sdk)

The easiest way to use the SDK:

```bash title="Install SDK"
pnpm add @ensnode/ensrainbow-sdk
```

```ts title="heal.ts"
import { EnsRainbowApiClient } from "@ensnode/ensrainbow-sdk";

const client = new EnsRainbowApiClient({
  endpointUrl: "https://api.ensrainbow.io",
  clientLabelSet: { labelSetId: "subgraph", labelSetVersion: 0 },
});

const res = await client.healLabel(
  "0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc",
);

if (res.status === "success") {
  console.log(res.label);
} else {
  console.error(res.error);
}
```

<Readme />