Skip to content

Safely verify that a received webhook originated from Trello.

License

Notifications You must be signed in to change notification settings

lukehorvat/verify-trello-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

verify-trello-webhook NPM version

Safely verify that a received webhook originated from Trello.

Uses crypto.timingSafeEqual(), so Node.js v6.6.0 (or newer) is required.

Installation

Install the package with NPM:

$ npm install verify-trello-webhook

Usage

Example:

import verifyTrelloWebhook from "verify-trello-webhook";

let signature = "LeCJzA5aHiwh4zcxLhY25TJSNg=";
let payload = JSON.stringify({ hello: "world" });
let secret = "secret";
let callbackUrl = "https://example.com/webhooks";

verifyTrelloWebhook(signature, payload, secret, callbackUrl); // Returns true if verification succeeds; otherwise, false.

Related

You may be interested in verify-github-webhook, a similar package for GitHub webhook verification.

Also, check out my other Trello packages:

About

Safely verify that a received webhook originated from Trello.

Resources

License

Stars

Watchers

Forks

Packages

No packages published