Express middleware for logentries webhook api, written in typescript with types available.
Logentries documentation on webhooks
const express = require('express');
const bodyParser = require('body-parser'); // Optional.
const logentriesWebhookAuth = require('logentries-webhook-auth');
const app = express();
// This step isn't necessary for authentication, but you'll want it
// if you want to parse the payload that LogEntries posts.
app.use(bodyParser.urlencoded({
extended: true
}));
// Use the middleware with a pre shared password.
app.use(logentriesWebhookAuth('password'));
// "user" is now available on request.logentriesWebhookAuth.user
// "payload" is now available on request.body
// ...Your routes here...
app.listen(3000);
npm install
- Setup dependencies and build projectnpm run build
- Build source files manuallynpm test
- Run tests
ENABLE_LOGENTRIES_WEBHOOK_AUTH_LOGGING
: Enable logging from this middleware. This will log hashes and signatures, don't enable this in production.