The SDK provides a helper class to verify webhook signatures.
Usage
import { LinearWebhooks, LINEAR_WEBHOOK_SIGNATURE_HEADER, LINEAR_WEBHOOK_TS_FIELD } from'@linear/sdk'constwebhook=newLinearWebhooks("WEBHOOK_SECRET");...// Use it in the webhook handler. Example with Express:app.use('/hooks/linear',bodyParser.json({verify: (req, res, buf) => {webhook.verify(buf,req.headers[LINEAR_WEBHOOK_SIGNATURE_HEADER] asstring,JSON.parse(buf.toString())[LINEAR_WEBHOOK_TS_FIELD]); } }), (req, res, next) => {//Handle the webhook eventnext() })