Server-to-Server Hooks

Webhook Notifications & Signatures

Server-to-server HTTP notifications for connection and channel lifecycle events.

Supported Webhook Event Types

connection.createdTriggered when a new WebSocket client completes the handshake
connection.closedTriggered when a client disconnects or times out
channel.createdTriggered when a channel transitions from empty to occupied
channel.vacatedTriggered when the last subscriber leaves a channel
message.publishedTriggered when an event is published to a channel

HMAC-SHA256 Signature Verification

Every webhook POST includes an X-Pusher-Signature header generated using your secret key:

const crypto = require("crypto");

function verifyWebhook(rawPayload, signatureHeader, webhookSecret) {
  const expected = crypto
    .createHmac("sha256", webhookSecret)
    .update(rawPayload)
    .digest("hex");

  return crypto.timingSafeEqual(
    Buffer.from(signatureHeader),
    Buffer.from(expected)
  );
}