Webhooks
Set a Webhook URL (HTTPS) in the app’s settings and choose the events you want:
| Event | Sent when |
|---|---|
channel_occupied |
A channel gets its first subscriber |
channel_vacated |
A channel loses its last subscriber |
member_added |
A user joins a presence channel |
member_removed |
A user leaves a presence channel |
client_event |
A client sends a client event |
Events are sent as a POST with a JSON body, batched for up to one second:
{ "time_ms": 1760781600000, "events": [ { "name": "channel_occupied", "channel": "presence-lobby" }, { "name": "member_added", "channel": "presence-lobby", "user_id": "42" } ]}Verifying the signature
Section titled “Verifying the signature”Every request carries X-Pusher-Key (your app key) and X-Pusher-Signature, the hex HMAC-SHA256 of the raw body with your app secret. The Pusher server libraries verify it for you:
const webhook = pusher.webhook({ headers: req.headers, rawBody: req.rawBody });if (!webhook.isValid()) return res.sendStatus(401);for (const event of webhook.getEvents()) { // ...}Answer with any 2xx status. A failed delivery (timeout after 5 seconds, or a non-2xx answer) is retried three times, after 1, 5 and 30 seconds. Redirects are not followed.