Mux v1.9.0 Mux.Webhooks View Source

This module provides a function for verifying webhook signatures

Link to this section Summary

Functions

Verifies a webhook signature. Pass in the raw request body, the signature header that came with the webhook request ('Mux-Signature') and the webhook "secret" from your webhooks dashboard. Note that the webhook secret is different than your API secret.

Link to this section Functions

Link to this function

verify_header(payload, signature_header, secret, tolerance \\ 300)

View Source

Verifies a webhook signature. Pass in the raw request body, the signature header that came with the webhook request ('Mux-Signature') and the webhook "secret" from your webhooks dashboard. Note that the webhook secret is different than your API secret.

Returns :ok. Or a tuple with {:error, "message"}

Examples

iex> Mux.Webhooks.verify_header(raw_request_body, signature_header, secret)
:ok