This context is normally available in the following:

  • Next App Router middleware
  • Next App Router route handler when using NextResponse to create the response of the route handler
interface NextRequestAndNextResponseContext {
    request: NextRequest;
    response: NextResponse<unknown>;
}

Properties

Properties

request: NextRequest
response: NextResponse<unknown>