Skip to content

Use case

Activity and event feeds

Audit trails, order flows and incident timelines are one shape: an append-only list somebody is watching. Loaded over HTTP, kept current by events.

private-account-3b1
  • private channels
  • events
  • webhooks

How it works

  1. 01Load, then subscribeFetch the page over HTTP, then subscribe — in that order, so nothing falls in the gap.
  2. 02Append on publishNew entries carry the same shape as the HTTP payload, so one renderer handles both.
  3. 03Scope by channelOne channel per account keeps authorisation simple — the subscription is the check.

Worth knowing

A client that reconnects has a gap. Re-fetch the head of the feed rather than assuming the socket caught everything.

In code

feed.js
js
const feed = await fetch('/api/activity?limit=50').then((r) => r.json())render(feed.items)// Same shape as the HTTP payload, so one renderer covers both.pusher.subscribe('private-account-3b1').bind('activity', (item) => {  prepend(item)})

Written with the official Pusher libraries, unmodified — there is no PushCaster package to install. Full documentation

Other things people build

All use cases
presence-room-42

Realtime chat

Rooms, membership and typing indicators on presence channels.

private-user-1e9

Notifications

One server event, delivered to every surface a user has open.

private-metrics

Live dashboards

Push metrics as they change instead of polling for them.

Create an application and build it.

Support