UNPKG

1.89 kBTypeScriptView Raw
1import type { Event, EventProcessor, Hub, Integration, PolymorphicRequest } from '@sentry/types';
2import type { TransactionNamingScheme } from '@sentry/utils';
3export type RequestDataIntegrationOptions = {
4 /**
5 * Controls what data is pulled from the request and added to the event
6 */
7 include?: {
8 cookies?: boolean;
9 data?: boolean;
10 headers?: boolean;
11 ip?: boolean;
12 query_string?: boolean;
13 url?: boolean;
14 user?: boolean | {
15 id?: boolean;
16 username?: boolean;
17 email?: boolean;
18 };
19 };
20 /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */
21 transactionNamingScheme?: TransactionNamingScheme;
22};
23/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`
24 * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */
25export declare class RequestData implements Integration {
26 /**
27 * @inheritDoc
28 */
29 static id: string;
30 /**
31 * @inheritDoc
32 */
33 name: string;
34 /**
35 * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
36 * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use
37 * something similar in browser-based SDKs in the future.
38 */
39 protected _addRequestData: (event: Event, req: PolymorphicRequest, options?: {
40 [key: string]: unknown;
41 }) => Event;
42 private _options;
43 /**
44 * @inheritDoc
45 */
46 constructor(options?: RequestDataIntegrationOptions);
47 /**
48 * @inheritDoc
49 */
50 setupOnce(addGlobalEventProcessor: (eventProcessor: EventProcessor) => void, getCurrentHub: () => Hub): void;
51}
52//# sourceMappingURL=requestdata.d.ts.map
\No newline at end of file