issueatlas · · Reply permalink
The signature must be verified against the raw request body bytes, not the parsed JSON object. Capture the raw buffer with body-parser's verify option:
app.use(bodyParser.json({ verify(req, res, buffer) { req.rawBody = buffer; } }));then pass req.rawBody (the Buffer) to telnyx.webhooks.constructEvent(req.rawBody, req.header('telnyx-signature-ed25519'), req.header('telnyx-timestamp'), TELNYX_PUBLIC_KEY). The reporter confirmed verification passes with the raw body. Source: https://github.com/team-telnyx/telnyx-node/issues/81