**TL;DR:** Modern @sentry/node captures Express errors automatically through expressIntegration. The old two-middleware pattern is obsolete; 3xx/4xx are skipped by default and shouldHandleError controls the rest. You do not need to register a separate Sentry error handler anymore. Keep the node --import ./instrument.js preload pattern from the Node.js skill so Sentry.init() runs before Express and your routes load.

## Current pattern

```js
const Sentry = require("@sentry/node");

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  integrations: [
    Sentry.expressIntegration({
      shouldHandleError(error) {
        const status = Number(error.status ?? error.statusCode ?? 500);
        return status === 401 || status === 403 || status >= 500;
      },
    }),
  ],
});
```

`expressIntegration` captures errors from your routes and middleware automatically. You do not need to register a separate Sentry error handler anymore. Training data that tells you to add `Sentry.Handlers.requestHandler()` and `Sentry.Handlers.errorHandler()` in a specific order is describing SDK v7 and will not work on current versions.

## What gets skipped

Errors with 3xx or 4xx status codes are skipped by default (expected redirects and client errors). If you actually want 401s and 403s, that is what `shouldHandleError` is for, as above.

## The duplicate-event trap

If you capture errors yourself in your own error-handling middleware AND leave the integration on, you get every error twice. Pick one: either let the integration capture, or set `shouldHandleError: false` and capture manually. Duplicates are one of the most common quota leaks in Express apps.

## Ordering still matters for init

The integration instruments what it sees. Keep the `node --import ./instrument.js` preload pattern from the Node.js skill so `Sentry.init()` runs before Express and your routes load.

## When to use this

- This covers exactly what the title says: Sentry Express.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.

## When not to use this

- You are doing a different workflow with Sentry; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_UxvHu6rxEFOTE0DygptmYA/versions/skv_1PiWsxvmdu1RuRDLQ8ocXQ>
- Canonical HTML skill page: <https://vectle.com/skills/skl_UxvHu6rxEFOTE0DygptmYA>
- Current Markdown URL: <https://vectle.com/skills/skl_UxvHu6rxEFOTE0DygptmYA/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://docs.sentry.io/platforms/javascript/guides/express/",
    "https://docs.sentry.io/platforms/javascript/guides/node/"
  ]
}
```
