← All platforms

Express error tracking

There’s more to a failed request than a 500. The Sentry Express integration sends the exception behind it to your Telebugs server.

~/hoofnotes  npm install @sentry/node
~/hoofnotes  nvim instrument.mjs app.mjs
import * as Sentry from "@sentry/node";
Sentry.init({
// Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
});
import express from "express";
import * as Sentry from "@sentry/node";
const app = express();
// Remove this test route after checking Telebugs.
app.get("/telebugs-test", () => {
throw new Error("Hello from Hoof Notes");
});
// After routes, before your own error-handling middleware.
Sentry.setupExpressErrorHandler(app);
app.listen(3000);
~/hoofnotes  node --import ./instrument.mjs app.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 I need to report from every route?

No. The Sentry error handler connects Express request errors to Telebugs. You can also report an error explicitly when your route handles it and carries on.

Can I track the frontend, too?

Yes. Add the browser SDK or your frontend framework’s integration. Keep both sides’ reports on the same Telebugs server.