AppView in a box as a Vite plugin thing
hatk.dev
1---
2title: Feeds
3description: Feed API endpoints.
4---
5
6## `dev.hatk.getFeed`
7
8Retrieve a named feed of items.
9
10- **Type:** Query (GET)
11- **Auth:** None
12
13### Parameters
14
15| Name | Type | Required | Default | Description |
16| -------- | ------- | -------- | ------- | ------------------------ |
17| `feed` | string | Yes | — | Feed name |
18| `limit` | integer | No | `30` | Results per page (1–100) |
19| `cursor` | string | No | — | Pagination cursor |
20
21### Example
22
23```bash
24curl "http://127.0.0.1:3000/xrpc/dev.hatk.getFeed?feed=recent&limit=20"
25```
26
27```typescript
28import { callXrpc } from "$hatk/client";
29
30const { items, cursor } = await callXrpc("dev.hatk.getFeed", {
31 feed: "recent",
32 limit: 20,
33});
34```
35
36### Response
37
38```json
39{
40 "items": [ ... ],
41 "cursor": "..."
42}
43```
44
45---
46
47## `dev.hatk.describeFeeds`
48
49List all available feeds.
50
51- **Type:** Query (GET)
52- **Auth:** None
53- **Parameters:** None
54
55### Example
56
57```bash
58curl "http://127.0.0.1:3000/xrpc/dev.hatk.describeFeeds"
59```
60
61### Response
62
63```json
64{
65 "feeds": [
66 { "name": "recent", "label": "Recent" },
67 { "name": "popular", "label": "Popular" }
68 ]
69}
70```
71
72---
73
74See [Feeds guide](/guides/feeds) for how to define feeds with `defineFeed()`.