1.35 kBTypeScriptView Raw
1interface Fastify {
2 register: (plugin: any) => void;
3 addHook: (hook: string, handler: (request: any, reply: any, error: Error) => void) => void;
4}
5export declare const instrumentFastify: ((options?: unknown) => void) & {
6 id: string;
7};
8/**
9 * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
10 *
11 * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
12 *
13 * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
14 *
15 * @example
16 * ```javascript
17 * const Sentry = require('@sentry/node');
18 *
19 * Sentry.init({
20 * integrations: [Sentry.fastifyIntegration()],
21 * })
22 * ```
23 */
24export declare const fastifyIntegration: () => import("@sentry/core").Integration;
25/**
26 * Add an Fastify error handler to capture errors to Sentry.
27 *
28 * @param fastify The Fastify instance to which to add the error handler
29 *
30 * @example
31 * ```javascript
32 * const Sentry = require('@sentry/node');
33 * const Fastify = require("fastify");
34 *
35 * const app = Fastify();
36 *
37 * Sentry.setupFastifyErrorHandler(app);
38 *
39 * // Add your routes, etc.
40 *
41 * app.listen({ port: 3000 });
42 * ```
43 */
44export declare function setupFastifyErrorHandler(fastify: Fastify): void;
45export {};
46//# sourceMappingURL=fastify.d.ts.map
\No newline at end of file