pusher-js and Pusher server-library code — the
only change from a stock Pusher app is the host. Point the client at the
TeleQuick realtime host and your existing code keeps working, because the wire
protocol is Pusher Channels either way. Copy a block, drop in your app
credentials, and run it.
You need an app’s key, secret, and app ID for these recipes. Mint
them in the Realtime Console under Apps &
keys — each app is a Pusher-compatible key/secret pair. The secret is shown
once; store it as an environment variable, never in client code.
realtime.telequick.dev and the control-plane
publish API lives on portal.telequick.dev. Replace <APP_KEY>, <APP_ID>,
and <APP_SECRET> with your own.
Subscribe to a public channel
Public channels are open — anyone with the app key can subscribe, no auth round trip. The only Pusher option that differs from a hosted Pusher app iswsHost.
WebTransport / QUIC transport. The same channels are reachable over
WebTransport/QUIC in addition to WebSocket — the wire is the identical Pusher
protocol, served on the
/app/<APP_KEY> path. Stock pusher-js uses WebSocket;
to opt into the QUIC transport, use the TeleQuick realtime client (a drop-in
pusher-js-compatible fork that adds WebTransport with automatic WebSocket
fallback). The subscribe/bind API is unchanged from the block above. See
Realtime — Details for the transport ladder.The TeleQuick realtime host,
realtime.telequick.dev. This is the single
line that repoints a stock Pusher client at TeleQuick.Always keep TLS on in production — connections are
wss:// and QUIC is TLS by
construction.Unused when
wsHost is set (there are no Pusher clusters here), but pusher-js
still expects the key to be present. Pass an empty string.Presence channels and a live member list
Presence channels (presence-*) track who is here. They require the same auth
step as private channels (below), and in return every subscriber gets the current
member roster plus member_added / member_removed events.
Subscribe and read the initial roster
pusher:subscription_succeeded fires once with the full member list.members.me, member.id, and member.info come straight from the
presence_data your auth endpoint returns (next section). The id must be
unique per user; info is arbitrary JSON you attach (name, avatar, role).Private channels and the server auth endpoint
Private (private-*) and presence (presence-*) channels require an
HMAC-signed subscription. When a client subscribes, pusher-js POSTs the
socket_id and channel_name to your channelAuthorization.endpoint; your
server decides whether that user may join and signs the grant with the app
secret. The signature is a standard Pusher auth token, so the stock Pusher
server library produces it for you.
Point the client at your auth endpoint
Set
channelAuthorization: { endpoint: "/pusher/auth" } (shown above). On
older pusher-js this option is called authEndpoint.Trigger an event from your server
Server-side publishing uses the Pusher server library pointed at the TeleQuick host.trigger(channel, event, data) fans the event out across the edge mesh to
every subscriber.
The REST
data field is a string — a JSON-encoded string of your payload,
not a nested object. The server libraries handle the encoding and the request
signature; reach for raw cURL only when you can’t run one, and grab the signed
version from the console’s Event Creator.Send a client event
Subscribers can publish directly to a channel with aclient- prefixed event —
useful for ephemeral signals like typing indicators or cursor positions, with no
server round trip. Client events are only allowed on private-* and
presence-* channels, and only when client events are enabled for the app.
Receive a webhook
TeleQuick POSTs signed event batches to endpoints you register in the console (Webhooks). Each request carries anX-Pusher-Signature header — an HMAC of
the raw body under the webhook’s signing secret. Verify it against the raw
bytes before parsing, and compare in constant time.
The signing secret is separate from your app secret and is shown once when you
add the webhook. The
X-Pusher-Key header also identifies which app key the
delivery is for. Channel existence (channel_occupied / channel_vacated)
and presence (member_added / member_removed) are shipped. Additional
groups shown in the console — client-event and cache-miss webhooks — are rolling
out; treat them as preview and confirm delivery for your deployment before you
depend on them.Related
Details
How the Pusher-compatible layer maps onto WebSocket and QUIC transports.
SDK & API
The client, server-publish, and auth surfaces in reference form.
Recipes
End-to-end builds: a live presence list and server-pushed notifications.
Console
Mint app keys, publish test events, and wire webhooks — no code.