https://github.com/richie-south/github-express-webhook-verifying
npm module: Validating payloads from GitHub
https://github.com/richie-south/github-express-webhook-verifying
express github nodejs npm
Last synced: 3 months ago
JSON representation
npm module: Validating payloads from GitHub
- Host: GitHub
- URL: https://github.com/richie-south/github-express-webhook-verifying
- Owner: richie-south
- Created: 2017-02-01T09:20:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T12:37:37.000Z (about 9 years ago)
- Last Synced: 2025-09-01T20:27:01.486Z (10 months ago)
- Topics: express, github, nodejs, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/github-express-webhook-verifying
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-express-webhook-verifying [](https://badge.fury.io/js/github-express-webhook-verifying)
Validating payloads from GitHub
## Install:
```
npm install github-express-webhook-verifying --save
```
## How to use:
Basic
```javascript
// You also need to use body-parser in express
app.use(bodyParser.json())
const verifyGithubWebhook = require('github-express-webhook-verifying')
const secret = 'MySecret!'
router.get('/', verifyGithubWebhook(secret), (req, res) => {
// Webhook is verifyed here!
})
```
With config
```javascript
// You also need to use body-parser in express
app.use(bodyParser.json())
const verifyGithubWebhook = require('github-express-webhook-verifying')
const secret = 'MySecret!'
const config = {
xHubSignatureNotFound: {
status: 400,
errorMessage: 'My custom message',
},
verifyingSignatureFailed: {
status: 403,
errorMessage: 'My other custom message',
},
}
router.get('/', verifyGithubWebhook(secret, config), (req, res) => {
// Webhook is verifyed here!
})
```
## TODO
- Tests