Webhooks
Webhooks - Provides access to the Mux Webhooks signature verification
Example:
const Mux = require('@mux/mux-node');
const { Webhooks } = Mux;
// Verify a webhook signature
Webhooks.verifyHeader(body, signature, secret);
Test:
Static Method Summary
Static Public Methods | ||
public static |
verifyHeader(body: string, signature: string, secret: string): boolean Verify a webhook signature. |
Static Public Methods
public static verifyHeader(body: string, signature: string, secret: string): boolean source
Verify a webhook signature. When enabled, Mux will send webhooks with a signature in the http request header 'Mux-Signature'. You can use that signature to verify that the webhook is indeed coming from Mux.
Throw:
throw error when a webhook signature verification fails. |
Example:
const Mux = require('@mux/mux-node');
const { Webhooks } = Mux;
// Verify a webhook signature
Webhooks.verifyHeader(body, signature, secret);