Skip to content

Commit 00fabe5

Browse files
authored
docs(nextjs): Clarify which API wrappers are intended for which router (#12867)
1 parent efcd9f3 commit 00fabe5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import {
2222
import { vercelWaitUntil } from './utils/vercelWaitUntil';
2323

2424
/**
25-
* Wraps a Next.js route handler with performance and error instrumentation.
25+
* Wraps a Next.js App Router Route handler with Sentry error and performance instrumentation.
26+
*
27+
* NOTICE: This wrapper is for App Router API routes. If you are looking to wrap Pages Router API routes use `wrapApiHandlerWithSentry` instead.
2628
*/
2729
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2830
export function wrapRouteHandlerWithSentry<F extends (...args: any[]) => any>(

packages/nextjs/src/index.types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export declare const metrics: typeof clientSdk.metrics & typeof serverSdk.metric
4141
export { withSentryConfig } from './config';
4242

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

0 commit comments

Comments
 (0)