← All platforms

Node.js error tracking

An exception. A rejected promise. Something to look at in the morning. The Sentry Node.js SDK sends your error reports to Telebugs on your server.

~/hoofnotes  npm install @sentry/node
~/hoofnotes  nvim instrument.mjs check-notes.mjs
import * as Sentry from "@sentry/node";
Sentry.init({
// Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
});
import * as Sentry from "@sentry/node";
// Remove this test once it appears in Telebugs.
Sentry.captureException(new Error("Hello from Hoof Notes"));
await Sentry.flush(2000);
~/hoofnotes  node --import ./instrument.mjs check-notes.mjs

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep @sentry/node. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

Do rejected promises count?

Yes. The SDK reports unhandled promise rejections and uncaught exceptions. Errors you catch yourself can go to Telebugs too, through Sentry.captureException.

What about my web app?

The Express integration adds request error handling. For code running in the browser, use the JavaScript SDK. Both can send reports to your Telebugs server.