Open pro1code1hack opened 3 months ago
Please describe your changes using the checklist below.
How to test this feature:
mysql> select * from users_webhooks; +--------------------------------------+--------------------------------------+------+-------------------------------+----------------------------+----------------------------+ | id | userId | name | url | createdAt | updatedAt | +--------------------------------------+--------------------------------------+------+-------------------------------+----------------------------+----------------------------+ | f04816b4-7516-44ba-9fb3-82e065667785 | c6df6997-80a9-4b27-9248-a15af0b97ca9 | Test | http://localhost:3000/webhook | 2024-07-11 21:12:51.266892 | 2024-07-12 20:05:35.460372 | +--------------------------------------+--------------------------------------+------+-------------------------------+----------------------------+----------------------------+
const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const port = 3000; app.use(bodyParser.json()); app.post('/webhook', (req, res) => { console.log('Received webhook:', req.body); res.status(200).send('Webhook received'); }); app.listen(port, () => { console.log(`Webhook receiver listening at http://localhost:${port}`); });
You should see the following output in the console:
{ event: 'user.alert.metrics', data: { alertName: 'Test Alert', projectName: 'Your awesome project', count: 0, queryMetric: 'page_views', queryCustomEvent: null, queryTime: '0' } }
Please describe your changes using the checklist below.
Self-hosted support
Database migrations
Documentation
How to test this feature:
You should see the following output in the console: