Skip to content

Commit

Permalink
docs(nextjs): Clarify which API wrappers are intended for which router
Browse files Browse the repository at this point in the history
ref #12865
  • Loading branch information
lforst committed Jul 11, 2024
1 parent 3549777 commit e3a794e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import {
import { vercelWaitUntil } from './utils/vercelWaitUntil';

/**
* Wraps a Next.js route handler with performance and error instrumentation.
* Wraps a Next.js App Router Route handler with Sentry error and performance instrumentation.
*
* NOTICE: This wrapper is for App Router API routes. If you are looking to wrap Pages Router API routes use `wrapApiHandlerWithSentry` instead.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function wrapRouteHandlerWithSentry<F extends (...args: any[]) => any>(
Expand Down
4 changes: 3 additions & 1 deletion packages/nextjs/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export declare const metrics: typeof clientSdk.metrics & typeof serverSdk.metric
export { withSentryConfig } from './config';

/**
* Wraps a Next.js API handler with Sentry error and performance instrumentation.
* Wraps a Next.js Pages Router API route with Sentry error and performance instrumentation.
*
* NOTICE: This wrapper is for Pages Router API routes. If you are looking to wrap App Router API routes use `wrapRouteHandlerWithSentry` instead.
*
* @param handler The handler exported from the API route file.
* @param parameterizedRoute The page's parameterized route.
Expand Down

0 comments on commit e3a794e

Please sign in to comment.