@sentry/nextjs
Version:
Official Sentry SDK for Next.js
27 lines (26 loc) • 1.29 kB
TypeScript
import { NextApiHandler } from './types';
/**
* Wrap the given API route handler for tracing and error capturing. Thin wrapper around `withSentry`, which only
* applies it if it hasn't already been applied.
*
* @param apiHandler The handler exported from the user's API page route file, which may or may not already be
* wrapped with `withSentry`
* @param parameterizedRoute The page's route, passed in via the proxy loader
* @returns The wrapped handler
*/
export declare function wrapApiHandlerWithSentry(apiHandler: NextApiHandler, parameterizedRoute: string): NextApiHandler;
/**
* @deprecated Use `wrapApiHandlerWithSentry()` instead
*/
export declare const withSentryAPI: typeof wrapApiHandlerWithSentry;
/**
* Legacy function for manually wrapping API route handlers, now used as the innards of `wrapApiHandlerWithSentry`.
*
* @param apiHandler The user's original API route handler
* @param parameterizedRoute The route whose handler is being wrapped. Meant for internal use only.
* @returns A wrapped version of the handler
*
* @deprecated Use `wrapApiWithSentry()` instead
*/
export declare function withSentry(apiHandler: NextApiHandler, parameterizedRoute?: string): NextApiHandler;
//# sourceMappingURL=wrapApiHandlerWithSentry.d.ts.map