Official lightweight Node.js SDK for Pingzo - uptime monitoring, public status pages, and instant WhatsApp alerts.
- Heartbeat Checks: Verify that background workers, cron jobs, and queues complete execution on time.
- Express.js Middleware: Expose structured
/healthzendpoints that automatically report server and database connectivity states. - Zero Dependencies: Exceptionally fast load times with no external dependency layers.
npm install @pingzoapp/sdkInitialize the client and send a ping notification at the end of key background routines:
const Pingzo = require('@pingzoapp/sdk');
const pingzo = new Pingzo('your_project_api_key');
async function processDailyInvoices() {
try {
// Your routine execution logic...
console.log('Invoices processed successfully.');
// Notify Pingzo that the task completed on schedule
pingzo.ping('invoice-cron-monitor-id');
} catch (err) {
console.error('Invoice run failed:', err.message);
}
}Register the middleware inside your web server configuration to handle automated uptime checks:
const express = require('express');
const Pingzo = require('@pingzoapp/sdk');
const app = express();
const pingzo = new Pingzo('your_project_api_key');
// Expose a health endpoint checking database connectivity
app.use(pingzo.expressMiddleware({
path: '/healthz',
customCheck: async () => {
// Perform database pool query check here
// Return true if healthy, false if unhealthy
return true;
}
}));
app.listen(3000, () => {
console.log('Express app running on port 3000');
});MIT - Aurexis Technologies Private Limited. See LICENSE for details.