# Realtime

URL: /code/platform/capabilities/realtime · Id: `capability:realtime`

> Realtime pushes Events, Messages and record changes to connected Apps and agents as they happen, resumable from a cursor.

Realtime pushes [Events](/business/nouns/event), [Messages](/business/nouns/message) and record changes to connected [Apps](/business/nouns/app) and agents as they happen. A client that drops resumes from its cursor and misses nothing.

## Contract
- A stream is a live read by Event selector, such as `Order.*`, under the caller's [Permissions](/business/nouns/permission).
- Every item carries a sequence number. A client reconnects with the last one it saw and receives every later item, in order.
- Streams run over web sockets or server-sent events at `wss://api.sb/<domain>/events/stream`, with `select` and `cursor` parameters.
- Presence and typing reach a [Channel](/business/nouns/channel)'s members live and are never stored.
- A stream is a read: it creates no [Action](/business/nouns/action) per item. Open connections count against a [Limit](/business/nouns/limit) per [Tenant](/business/nouns/tenant).
- One Channel carries up to 1,000 Messages a second, then shards by [Thread](/business/nouns/thread).
- An [Agent](/business/nouns/agent) in a Channel receives its Messages as they arrive. [Dashboards](/business/nouns/dashboard) refresh live for people.

## Verbs
None.

## Interfaces
- [API](/code/api/reference)
- [SDK](/code/sdk/reference)
- [CLI](/code/cli/reference)
- [MCP](/code/mcp/reference)

## Example
```ts
// crumbrun.com delivers from neighborhood bakeries. Each bakery's kitchen screen
// shows new orders the moment they are placed, and survives a dropped connection.
import { $ } from 'startup-builder'

const tickets = document.querySelector('#tickets')!
const cursor = localStorage.getItem('cursor') ?? undefined

for await (const event of $.stream('Order.placed', { cursor })) {
  tickets.append(`${event.data.order.$id}\n`)
  localStorage.setItem('cursor', String(event.seq))
}
```