nextjs-middleware

Manages Tailwind-CSS-based web and mobile interfaces with a visual builder.

51|10|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/JosiahSiegel/claude-plugin-marketplace --skill nextjs-middleware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-middleware
Source: https://github.com/JosiahSiegel/claude-plugin-marketplace/tree/main/plugins/nextjs-master/skills/nextjs-middleware
Command: npx skills add https://github.com/JosiahSiegel/claude-plugin-marketplace --skill nextjs-middleware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the management of incoming requests in Next.js applications, enabling robust control over routing, security, and user experience at the Edge or in Node.js environments.

Core Features & Use Cases

  • Dynamic Routing & Rewrites: Implement complex redirect and rewrite rules based on request properties.
  • Security & Authentication: Protect routes, enforce role-based access, and set security headers.
  • Internationalization: Handle locale detection and redirection for global applications.
  • Use Case: Automatically redirect users to their localized version of the site based on their browser settings or a persistent cookie, while also protecting sensitive API routes with authentication checks.

Quick Start

Use the nextjs-middleware skill to create a middleware.ts file that protects all routes under /admin with role-based access control.

Frequently Asked Questions about nextjs-middleware

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

FAQPage Schema
How do I protect routes with authentication in Next.js middleware?

Next.js middleware protects routes with authentication by inspecting incoming requests in a middleware.ts file to enforce role-based access control before rendering or API execution.

What's the best way to handle internationalization redirects in Next.js?

Handle internationalization redirects in Next.js middleware by detecting user locale from browser settings or persistent cookies, then dynamically redirecting requests to the localized URL path.

Can I run Next.js middleware in both Edge and Node.js runtimes?

Yes, Next.js middleware supports both Edge and Node.js runtimes to manage incoming requests, allowing flexible execution environments for routing, security headers, and geolocation data access.

How do I create dynamic URL matching and rewrites in Next.js?

Create dynamic URL matching and rewrites in Next.js by configuring middleware rules that evaluate request properties like paths and headers to perform complex redirects and rewrites dynamically.

Does Next.js middleware support cookie and header manipulation for security?

Yes, Next.js middleware supports cookie and header manipulation to enforce security policies, add security headers, and manage authentication tokens during incoming request processing.

When do I need geolocation data access in Next.js middleware?

Geolocation data access is needed in Next.js middleware when optimizing request handling for global applications, enabling location-based routing, localized content delivery, and region-specific access rules.