# Activity Feed

> An issue's activity timeline: comments as cards on a rail, every other change as a compact line with its own icon (status pills, assignees, labels, priority, due dates, commits, files), grouped by day. Long runs fold into "Show n more", reactions toggle, times read relative with the full date on hover, an All / Comments / History filter, and a composer that posts on ⌘↩.

- Slug: `activity-feed`
- Category: [Timelines](https://www.assembli.design/category/timelines.md)
- Type: component
- Tags: activity, feed, timeline, history, comments, audit-log, issue, reactions
- npm dependencies: lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/activity-feed
- Page: https://www.assembli.design/components/activity-feed

![Activity Feed preview](https://www.assembli.design/thumbnails/activity-feed-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` (required) | `ActivityItem[]` |  |  |
| `viewer` | `ActivityActor` |  | The signed-in person, shown on the composer. Leave out to hide the composer. |
| `onComment` | `(text: string) => void` |  | Called with the text of a new comment. The feed shows it straight away. |
| `collapseAfter` | `number` | `4` | Runs of more than this many non-comment events fold into a "Show n more" row. |
| `now` | `Date` |  | "Now" for relative times. Leave out to use the reader's clock (times render as dates until hydration). |
| `title` | `React.ReactNode` | `"Activity"` |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/activity-feed/activity-feed.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/activity-feed
```

Registry item JSON: https://www.assembli.design/r/activity-feed.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
