Error monitoring for Node.js.
With @sentry/node, your Node.js app reports unhandled errors, Express errors and rejected promises to Fehlo.
As of 21 October 2026, @sentry/node 11.8.0. Tested with Fehlo on 19 October 2026.
1. Install the package
npm install @sentry/nodeVersion 11 needs Node.js 20.19 or later, and 22.12 or later on Node.js 22.
2. Start the SDK
The SDK has to load before your app loads its modules, so it gets a file of its own. With CommonJS:
const Sentry = require("@sentry/node");
Sentry.init({
dsn: "https://<key>@app.fehlo.de/<project-id>",
environment: process.env.NODE_ENV,
release: "my-api@1.0.0",
dataCollection: {
userInfo: false,
},
});With ES modules:
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: "https://<key>@app.fehlo.de/<project-id>",
environment: process.env.NODE_ENV,
release: "my-api@1.0.0",
dataCollection: {
userInfo: false,
},
});Then start the app with --import. Since version 11 that applies to CommonJS too; --require is no longer supported.
node --import ./instrument.js app.js
node --import ./instrument.mjs app.mjs3. Express
Since version 11 the SDK captures Express errors on its own, so you no longer need setupExpressErrorHandler. It reports errors with status 500 and above, and errors without a status. To test:
const express = require("express");
const app = express();
app.get("/debug-fehlo", () => {
throw new Error("Fehlo test error");
});
app.listen(3000);Open http://localhost:3000/debug-fehlo; the error appears in Fehlo within a few seconds. To see 401 and 403 as well, add to Sentry.init:
integrations: [
Sentry.expressIntegration({
shouldHandleError(error) {
const status = Number(error.status ?? error.statusCode ?? 500);
return status === 401 || status === 403 || status >= 500;
},
}),
],4. Source maps for TypeScript
If you compile TypeScript to dist, upload the source maps after the build so stack traces point at your .ts files:
export SENTRY_URL=https://app.fehlo.de/
export SENTRY_ORG=<organisation-slug>
export SENTRY_PROJECT=<project-slug>
export SENTRY_AUTH_TOKEN=<token>
npx sentry-cli sourcemaps inject dist
npx sentry-cli sourcemaps upload --release "my-api@1.0.0" distCreate the token in Fehlo under Settings, API tokens, with the preset "For source maps". The organisation and project slugs are in the address bar of the project settings: /<organisation>/settings/projects/<project>.
Measure performance
Add tracesSampleRate: 0.2, to Sentry.init. Transactions count against your plan's own transaction allowance, not against your events.
Questions
Nothing arrives. What should I check?
First the DSN: it has to point at app.fehlo.de. Second, whether your server or browser can reach https://app.fehlo.de (firewall, proxy, ad blocker). Third, whether this month's quota is used up; you get an email when it is. Fourth, whether sampleRate or beforeSend drops events. If only performance data is missing, this month's transactions may be used up.