Monitor your Node.js scripts and jobs with MoniTao heartbeat.
Node.js is widely used for async jobs, workers, and processing scripts. MoniTao heartbeat integration is simple with standard HTTP libraries.
Here are examples for different contexts: fetch API, axios, and native https module.
Available natively since Node.js 18+:
await fetch('https://monitao.com/api/heartbeat/ping/YOUR_TOKEN', {\n method: 'POST'\n});
If you're already using axios in your project:
const axios = require('axios');\n\nawait axios.post('https://monitao.com/api/heartbeat/ping/YOUR_TOKEN');
seo.heartbeat_nodejs.cron_intro
seo.heartbeat_nodejs.cron_example
Add the ping at the end of your processor. Bull also lets you use completed events to trigger the ping.
Not necessarily. If you want the script to terminate after the ping is confirmed, use await. Otherwise, fire-and-forget.
Wrap in a try/catch. If the ping fails (MoniTao down, network), log but don't crash your job. It's monitoring, not a critical dependency.
Yes, send a JSON body with duration, status, and other metrics. MoniTao records them for history.
Start free, no credit card required.