> ## 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

> Metadata 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>

## Add or update a metadata record

Add or update a metadata record.

```typescript theme={null}
await client.addDataRecord(
  'alice.example.eth',
  'membership-tier',
  'pro',
);
```

**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>

## Delete a metadata record

Delete a metadata record.

```typescript theme={null}
await client.deleteDataRecord('alice.example.eth', 'membership-tier');
```

## Get all metadata records

Get all metadata records for a subname.

```typescript theme={null}
const allMetadata = await client.getDataRecords('alice.example.eth');
// Returns: Record<string, unknown>
```

**Example Result:**

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

## Get one metadata record

Get a specific metadata record by key.

```typescript theme={null}
const response = await client.getDataRecord(
  'alice.example.eth',
  'membership-tier',
);
const data = response.record; // 'pro'
```

**Return Type:**

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.