nextjs-server-runtime

Reference Next.js 16 server runtime APIs for request and response handling.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/xabierlameiro/price-tracker --skill nextjs-server-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-server-runtime
Source: https://github.com/xabierlameiro/price-tracker/tree/main/.agents/skills/nextjs-server-runtime
Command: npx skills add https://github.com/xabierlameiro/price-tracker --skill nextjs-server-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive reference for Next.js 16's server runtime APIs, enabling developers to efficiently handle requests, responses, and user agent information within serverless functions and route handlers.

Core Features & Use Cases

  • Request & Response Handling: Understand and utilize NextRequest and NextResponse for managing HTTP requests and crafting responses.
  • User Agent Detection: Parse User-Agent headers to identify browser, OS, and device details.
  • Font Runtime APIs: Reference the properties of NextFont for integrating custom fonts.
  • Use Case: When building a dynamic API route, use this Skill to inspect incoming request headers, set cookies in the response, and conditionally rewrite the URL based on the client's device type.

Quick Start

Use the nextjs-server-runtime skill to understand how to set a cookie in a NextResponse object.

Frequently Asked Questions about nextjs-server-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage cookies in Next.js 16 server runtime?

Parse the User-Agent header in Next.js 16 by using the userAgent helper, which extracts browser, operating system, and device details for server-side conditional logic.

Can I manipulate HTTP responses with NextResponse in route handlers?

Yes, you can manipulate HTTP responses with NextResponse in route handlers to craft custom outputs, redirect requests, and rewrite URLs based on incoming request data.

Does Next.js 16 provide geolocation data in the server runtime?

Next.js 16 provides geolocation data within its server runtime APIs, allowing you to access client location details directly from the incoming request for localized content delivery.

What is the best way to handle device detection in Next.js server components?

The best way to handle device detection in Next.js server components is parsing the User-Agent header with the userAgent API to identify the client's browser and device type.

How do I access request headers using NextRequest in Next.js 16?

Access request headers using NextRequest in Next.js 16 by interacting with the request object provided to your serverless functions to inspect and process incoming HTTP traffic.