Overview & Quick Start
Next.js App Router Health Routes
@nexload-sdk/healthcheck-next
v2.1.0 Stable ReleasedNext.js App Router route factories for @nexload-sdk/healthcheck.
Next.js App RouterNode.js
@nexload-sdk/healthcheck-next binds @nexload-sdk/healthcheck to Next.js App Router Route Handlers. It automatically enforces Cache-Control: no-store headers, prevents static optimization of health endpoints, maps status codes to Kubernetes expectations, and provides token-based proxy protection.
10-Second Code Snippet
Section titled “10-Second Code Snippet”import { createHealthManager } from "@nexload-sdk/healthcheck";import { createNextHealthRoute } from "@nexload-sdk/healthcheck-next";
const health = createHealthManager({ service: { name: "web-storefront" },});
export const { GET } = createNextHealthRoute({ health, scope: "readiness",});What You Get
Section titled “What You Get”- Next.js App Router Handlers: Export
GETandHEADhandlers compliant with Next.js 14, 15, and canary. - Zero-Cache Guarantees: Forces
force-dynamicbehavior withCache-Control: no-store, no-cache, must-revalidateto prevent CDN and browser caching. - HTTP Status Code Mapping: Returns
200 OKfor"ok"and"degraded", and503 Service Unavailablefor"unhealthy". - Diagnostics Authorization: Protect operational details behind Bearer tokens or secret headers when exposing internal metrics.
Installation & Requirements
Section titled “Installation & Requirements”pnpm add @nexload-sdk/healthcheck-next @nexload-sdk/healthcheck nextWith alternative package managers:
# npmnpm install @nexload-sdk/healthcheck-next @nexload-sdk/healthcheck next
# bunbun add @nexload-sdk/healthcheck-next @nexload-sdk/healthcheck nextRequires Next.js >=14.0.0 and Node.js >=20.9.0.
Next Steps
Section titled “Next Steps”- Explore Production Guides & Route Recipes for liveness vs readiness routes, proxy authorization, and troubleshooting.
- Check the API Reference & Signatures for all exported route creators and options.