RequestData
Adds data about an incoming request to an event. (default)
This integration only works inside server environments (Node.js, Bun, Deno).
Import name: Sentry.requestDataIntegration
This integration is enabled by default. If you'd like to modify your default integrations, read this.
This integration adds data from incoming requests to transaction and error events that occur during request handling.
Copied
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.requestDataIntegration()],
});
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.requestDataIntegration()],
});
The include option will likely be removed in a future SDK version. Use the dataCollection option instead.
By passing an include option, you can define what data from a request you want to capture:
Copied
requestDataIntegration({
// Controls what types of data are added to the event - consider using `dataCollection` in the `init()` options
include: {
cookies: boolean // default: true,
data: boolean // default: true,
headers: boolean // default: true,
ip: boolean // default: false,
query_string: boolean // default: true,
url: boolean // default: true,
},
})
requestDataIntegration({
// Controls what types of data are added to the event - consider using `dataCollection` in the `init()` options
include: {
cookies: boolean // default: true,
data: boolean // default: true,
headers: boolean // default: true,
ip: boolean // default: false,
query_string: boolean // default: true,
url: boolean // default: true,
},
})
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").