Webhooks
Rather than polling for packaging progress, register an endpoint and receive events as they happen.
Events
| Event | Fires when |
|---|---|
asset.created | An upload has been accepted and queued for packaging. |
asset.ready | Every rendition is packaged and the manifest is published. |
asset.failed | Packaging failed. The payload carries a reason. |
asset.deleted | The asset and its segments have been purged from all edges. |
Verifying a delivery
Each request carries a StreamPlume-Signature header: a timestamp and an HMAC-SHA256 of the raw body, keyed with your endpoint secret. Compare in constant time and reject anything older than five minutes.
const [ts, sig] = header.split(",").map(p => p.split("=")[1]); const expected = crypto.createHmac("sha256", secret) .update(ts + "." + rawBody).digest("hex"); if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) return 400;
Respond with any 2xx within ten seconds. Non-2xx responses are retried with exponential backoff for up to 24 hours.