> ## Documentation Index
> Fetch the complete documentation index at: https://docs.namespace.ninja/llms.txt
> Use this file to discover all available pages before exploring further.

# Metadata Records

> Manage custom metadata records for ENS subnames. Useful for discovery and filtering.

Custom key-value metadata records for offchain ENS subnames. Not used for onchain resolution but useful for discovery and filtering via  [`getFilteredSubnames`](/developer-guide/sdks/offchain-manager/get-filtered-subnames).

<Hint type="warning">
  Do not store sensitive information. Values are retrievable by anyone with read access.
</Hint>

### 1. addDataRecord

Add or update a metadata record.

```typescript theme={null}
await client.addDataRecord({
  subname: "ns.myensname.eth",
  key: "token-holder",
  data: "1200",
});
```

**Parameters:**

* `subname` - Full ENS subname
* `key` - Case-sensitive metadata key
* `data` - Value to store (string)

<Warning>
  If the key exists, its value will be overwritten.
</Warning>

### 2. deleteDataRecord

Delete a metadata record.

```typescript theme={null}
await client.deleteDataRecord({
  subname: "ns.myensname.eth",
  key: "token-holder",
});
```

### 3. getDataRecords

Get all metadata records for a subname.

```typescript theme={null}
const allMetadata = await client.getDataRecords("ns.myensname.eth");
// Returns: Record<string, string>
```

**Example Result:**

```json theme={null}
{
  "token-holder": "1200",
  "segment": "pro"
}
```

### 4. getDataRecord

Get a specific metadata record by key.

```typescript theme={null}
const response = await client.getDataRecord("ns.myensname.eth", "token-holder");
const data = response.record; // "1200"
```

**Return Type:**

```typescript theme={null}
interface GetRecordResponse {
  record: string;
}
```
