Learn how to set up a webhook using Node.js and Ngrok to receive notifications from Livepeer.
app.js
file in your project directory and set up an Express.js
server:
Livepeer-Signature
header.t=
and the signature is prefixed by a scheme.v
, followed by an integer. Currently, the only valid
signature scheme is v1. Livepeer Studio generates signatures using HMAC with
SHA2-256.,
character as the separator, to get a list of
elements.=
character as the separator, to get a prefix
and value pair.t
corresponds to the timestamp, and v1
corresponds
to the signature (or signatures). You can discard all other elements.
signed_payload
is the raw request payload.
It is important to note that the JSON
in the request payload includes the same
timestamp
from the signature header to protect against replay attacks.
Compare the signature (or signatures) in the header to the expected signature.
signed_payload
string as described.console.log
statements in your Express.js route handler to output the
request headers, body, and any other relevant information to the console.