express-clickup
v2.0.2
Published
An Express middleware for handling validation of Clickup Webhooks
Downloads
19
Maintainers
Readme
express-clickup
An Express middleware for handling validation of Clickup Webhooks
Installation
npm install express-clickup
Usage
// javascript
const express = require('express');
const { clickupWebhook } = require('express-clickup');
const app = express();
app.use(express.json());
// Initialize middleware with config
const clickupWebhookOptions = {
webhooks: [
{
id: '689a169-a000-4985-8676-6902b96d6627',
secret: 'f7bc83f430538424b13298e6aa6',
},
],
};
const isValidClickupWebhook = clickupWebhook(clickupWebhookOptions);
// use the middleware on a route
app.post('/webhook', isValidClickupWebhook, (req, res) => {
console.log('A valid clickup webhook has been received');
});
app.listen(3000, () => {
console.log('The server is now live');
});
// typescript
import * as express from'express';
import { clickupWebhook, ClickupMiddlewareConfig } from 'express-clickup';
const app = express();
app.use(express.json());
// Initialize middleware with config
const clickupWebhookOptions: ClickupMiddlewareConfig = {
webhooks: [
{
id: '689a169-a000-4985-8676-6902b96d6627',
secret: 'f7bc83f430538424b13298e6aa6',
},
],
};
const isValidClickupWebhook = clickupWebhook(clickupWebhookOptions);
// use the middleware on a route
app.post('/webhook', isValidClickupWebhook, (req, res) => {
console.log('A valid clickup webhook has been received');
});
app.listen(3000, () => {
console.log('The server is now live');
});
Disclaimer
The clickup-express package is unofficial and therefor not endorsed or affiliated with ClickUp or it's subsidaries.