Start
Introduction
Typed events, presence and durable AI streams over one connection per channel.
Pulse gives an app three realtime primitives behind one API: typed events, presence, and durable AI streams of plain text or AG-UI events. Each is one line in the browser, and each runs over the same connection to a channel.
How it fits together
- Your server holds a secret key. It signs short-lived tokens for the browser and publishes events.
- A browser connects to a channel with its token. A channel is just a name, like
orders:42orchat:9f2c: it exists once something uses it, with nothing to create or configure. - Every event on a channel is stored before anyone receives it, so a client that drops gets exactly what it missed when it comes back.
The three primitives
| Primitive | What it's for |
|---|---|
| Events | Typed messages your server or the browser publishes: order updates, notifications, chat. Ordered, stored and replayed. |
| Presence | Who's on a channel and their live state: cursors, selections, typing. The newest state wins. |
| AI streams | A model's output as plain text, or an agent's run as AG-UI events with tool calls and approvals, token by token, with Stop. A refresh replays it, then follows live. |
Start with the Quickstart, then read the page for the primitive you need: Events, Presence or AI streams.
Packages
| Package | Use it for |
|---|---|
@anishroy/pulse/server | Your server: tokens, publishing, reading history, writing AI streams. |
@anishroy/pulse/react | Hooks: useEvent, useChannel, usePresence, useTyping, useStream. |
@anishroy/pulse/ui | Optional components: live cursors, presence avatars, a typing indicator, chat messages with approval cards. |
@anishroy/pulse/client | The browser client without React (3.2 KB minified and gzipped). |
@anishroy/pulse/ai-sdk | PulseChatTransport: answers for the AI SDK's useChat that survive a refresh. |
With a coding agent
Point your agent at https://pulse.anishroy.com/agents.md: how to add Pulse to an app, and the rules that keep it right. It is an Agent Skill too, so you can keep it with your agent's skills:
Every docs page is also Markdown: add .md to its URL, or start from /llms.txt, the index, or /llms-full.txt, every page in one file.
Limits
- 1 MB per message
- 5,000 connections per channel
- 1,000 presence members per channel
- 10 / s presence updates per connection
- 7 days of history (24 hours by default)