UNPKG

1.25 kBTypeScriptView Raw
1type ConnectApp = {
2 use: (middleware: any) => void;
3};
4export declare const instrumentConnect: ((options?: unknown) => void) & {
5 id: string;
6};
7/**
8 * Adds Sentry tracing instrumentation for [Connect](https://github.com/senchalabs/connect/).
9 *
10 * If you also want to capture errors, you need to call `setupConnectErrorHandler(app)` after you initialize your connect app.
11 *
12 * For more information, see the [connect documentation](https://docs.sentry.io/platforms/javascript/guides/connect/).
13 *
14 * @example
15 * ```javascript
16 * const Sentry = require('@sentry/node');
17 *
18 * Sentry.init({
19 * integrations: [Sentry.connectIntegration()],
20 * })
21 * ```
22 */
23export declare const connectIntegration: () => import("@sentry/core").Integration;
24/**
25 * Add a Connect middleware to capture errors to Sentry.
26 *
27 * @param app The Connect app to attach the error handler to
28 *
29 * @example
30 * ```javascript
31 * const Sentry = require('@sentry/node');
32 * const connect = require("connect");
33 *
34 * const app = connect();
35 *
36 * Sentry.setupConnectErrorHandler(app);
37 *
38 * // Add you connect routes here
39 *
40 * app.listen(3000);
41 * ```
42 */
43export declare const setupConnectErrorHandler: (app: ConnectApp) => void;
44export {};
45//# sourceMappingURL=connect.d.ts.map
\No newline at end of file