Skip to main content

Static Next.js Docs With Interactive API Explorer

Finding

You can ship an interactive OpenAPI explorer inside a static Next.js App Router site, but the embed must be client-only.

Why It Matters

Static export (output: "export") keeps hosting simple while still giving developers a “Try it out” workflow. This reduces onboarding friction and support load.

Key Detail (Next.js 16.2.x)

next/dynamic({ ssr: false }) is not allowed in Server Components. Render Swagger UI from a Client Component ("use client") and import that component from the route.

Result

We produced a static /docs route that builds cleanly and renders Swagger UI against a vendored iris-api.openapi.yaml.