Task
How to verify if a webhook notification is actually coming from Nylas? This can be done by verifying Nylas webhook signatures using the code snippet below. This code is written in Javascript.
Instructions
function verify_nylas_request(req) {
const digest = crypto
.createHmac('sha256', config.nylasClientSecret)
.update(req.rawBody)
.digest('hex');
return digest === req.get('x-nylas-signature');
}
Resources
A GitHub example on implementing webhooks
Updated
Comments
0 comments
Please sign in to leave a comment.