UNPKG

1.3 kBTypeScriptView Raw
1export declare const instrumentKoa: ((options?: unknown) => void) & {
2 id: string;
3};
4/**
5 * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/).
6 *
7 * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server.
8 *
9 * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/).
10 *
11 * @example
12 * ```javascript
13 * const Sentry = require('@sentry/node');
14 *
15 * Sentry.init({
16 * integrations: [Sentry.koaIntegration()],
17 * })
18 * ```
19 */
20export declare const koaIntegration: () => import("@sentry/core").Integration;
21/**
22 * Add an Koa error handler to capture errors to Sentry.
23 *
24 * The error handler must be before any other middleware and after all controllers.
25 *
26 * @param app The Express instances
27 * @param options {ExpressHandlerOptions} Configuration options for the handler
28 *
29 * @example
30 * ```javascript
31 * const Sentry = require('@sentry/node');
32 * const Koa = require("koa");
33 *
34 * const app = new Koa();
35 *
36 * Sentry.setupKoaErrorHandler(app);
37 *
38 * // Add your routes, etc.
39 *
40 * app.listen(3000);
41 * ```
42 */
43export declare const setupKoaErrorHandler: (app: {
44 use: (arg0: (ctx: any, next: any) => Promise<void>) => void;
45}) => void;
46//# sourceMappingURL=koa.d.ts.map
\No newline at end of file