pusher-js and the
stock Pusher server libraries — the only thing that changes is the host you
point them at, so everything below drops straight into an existing Pusher
codebase.
Live presence list
A “who’s online” roster on a
presence-* channel: an auth endpoint that
signs the subscription, plus a client that tracks members joining and
leaving in real time.Server-pushed notifications
Your backend triggers events; the browser binds and renders them, and keeps
working across reconnects because channel state is restored on resubscribe.
Every snippet assumes you created an app in the
Realtime Console and have its key, secret,
and app ID to hand. The key is public (it ships in the browser bundle); the
secret is server-only.
The one-line switch
All you change to run on TeleQuick is the host. Keep your key, your channel names, your event names, and your handlers.Recipe 1 — Live presence list
Presence channels (presence-*) are private channels that also carry a
member roster. On subscribe you get the current members and every subsequent
join/leave, so you can render “who’s online” with no polling.
Because presence channels are authorized, you need a small auth endpoint.
TeleQuick verifies its HMAC exactly like Pusher does, so you sign the
subscription with the stock server library’s authorizeChannel.
Add the auth endpoint
When the browser subscribes to a
private-* or presence-* channel,
pusher-js POSTs the socket_id and channel_name to your
channelAuthorization.endpoint. Return the signed payload. For presence,
attach the member’s user_id and public user_info — this is what other
clients see in the roster, so put only display-safe fields here.Subscribe and render the roster
On the client, subscribe to a
presence-* channel and read members. The
pusher:subscription_succeeded event gives you the initial roster;
pusher:member_added / pusher:member_removed keep it live.React to presence from your backend (optional)
Register the Presence webhook group in the console to receive
member_added / member_removed server-side — handy for “mark user offline”
logic without keeping a socket open. See
console → webhooks
for the delivery format and how to verify the X-Pusher-Signature HMAC.A member’s presence is derived from their live connection. When a client’s last
tab closes — or the network drops long enough — TeleQuick emits
member_removed, so the roster self-heals without any client-side heartbeat.
Fan-out spans shards and edge nodes automatically; you never run or name a
message broker.Recipe 2 — Server-pushed notifications
The classic pattern: your backend does work (an order ships, a job finishes) and you want it to appear instantly in the user’s browser. Publish from the server withtrigger(); bind on the client.
Use a private per-user channel (private-notifications-<userId>) so only the
authorized user receives their notifications — reusing the same auth endpoint
from Recipe 1.
Publish from the server
Anywhere in your backend, call
trigger(channel, event, data). That single
call fans the event out to every connected subscriber of that channel across
the mesh.The REST body’s
data is a string, exactly as in the Pusher HTTP API —
JSON-encode your payload before putting it in the field. The server libraries
do this for you. Authenticated publish (signing the request with your app
secret) is handled by the server libraries; see
console → publish a test event
to try it from the browser first.Bind on the client
Subscribe to the user’s private channel and bind the event. Rendering a
toast, incrementing a badge, and playing a sound are all just handlers.
Survive reconnects
Connections drop — laptops sleep, phones switch from WiFi to cellular. You do
not re-subscribe by hand:
pusher-js replays your subscriptions and
re-runs your auth endpoint automatically when the socket comes back, and
TeleQuick carries the connection across a network change without a full
reconnect where it can. Bind the connection lifecycle to drive UI, and
backfill anything that may have been published while you were offline —
the channel is live-only, so durable state comes from your own API.Notification fan-out uses the same
trigger() → subscriber path as presence,
spread across shards and edge nodes. You publish once; delivery to every online
subscriber of the channel is handled for you.Honest gaps
Shipped and used above: public /
private-* / presence-* channels, HMAC
subscription auth, client-* events, server trigger(), the REST publish API,
and the channel-existence + presence webhook groups.Still rolling out: some webhook and batch-delivery features (for example
batched event webhooks and larger multi-channel publishes) are in preview and
may lag the hosted Pusher feature set. If a build depends on one, confirm it in
the Realtime Console for your app before shipping.Related
Details
The channel model, transports (WebSocket and QUIC), and how fan-out works.
SDK & API
The client, server-publish, and auth surfaces — and which pusher-js to use.
Cookbook
Shorter copy-paste snippets: subscribe, private auth, client events, webhooks.
Console
Create apps and keys, publish test events, watch live stats, wire webhooks.