~ knotless Search/
↑↓ move↵ open⇧↵ all results

peterullrich.com/hatk

AT Protocol app framework

Forked from chadtmiller.com/hatk

0
0
main
74 lines · 1.3 KB Raw History
---
title: Feeds
description: Feed API endpoints.
---

## `dev.hatk.getFeed`

Retrieve a named feed of items.

- **Type:** Query (GET)
- **Auth:** None

### Parameters

| Name     | Type    | Required | Default | Description              |
| -------- | ------- | -------- | ------- | ------------------------ |
| `feed`   | string  | Yes      | —       | Feed name                |
| `limit`  | integer | No       | `30`    | Results per page (1–100) |
| `cursor` | string  | No       | —       | Pagination cursor        |

### Example

```bash
curl "http://127.0.0.1:3000/xrpc/dev.hatk.getFeed?feed=recent&limit=20"
```

```typescript
import { callXrpc } from '$hatk/client'

const { items, cursor } = await callXrpc('dev.hatk.getFeed', {
  feed: 'recent',
  limit: 20,
})
```

### Response

```json
{
  "items": [ ... ],
  "cursor": "..."
}
```

---

## `dev.hatk.describeFeeds`

List all available feeds.

- **Type:** Query (GET)
- **Auth:** None
- **Parameters:** None

### Example

```bash
curl "http://127.0.0.1:3000/xrpc/dev.hatk.describeFeeds"
```

### Response

```json
{
  "feeds": [
    { "name": "recent", "label": "Recent" },
    { "name": "popular", "label": "Popular" }
  ]
}
```

---

See [Feeds guide](/guides/feeds) for how to define feeds with `defineFeed()`.