@scalar/nextjs-api-reference
v0.12.1
Published
Next.js API route handler to serve beautiful, interactive API documentation from OpenAPI/Swagger documents.
Readme
Scalar API Reference Handler for Next.js
Next.js API route handler to serve beautiful, interactive API documentation from OpenAPI/Swagger documents.
Scalar is an open-source API platform for teams who want beautiful developer interfaces without vendor lock-in.
- API References — Interactive API documentation from OpenAPI and AsyncAPI specs.
- Developer Docs — Write in Markdown/MDX, generate API references, sync with two-way Git.
- SDK Generator — Type-safe SDKs and CLIs in TypeScript, Python, Go, PHP, Java, and Ruby.
- API Client — Open-source, offline-first Postman alternative built on OpenAPI.
20M+ monthly npm installs · 15,500+ GitHub stars · MIT licensed · scalar.com
Documentation
Quickstart
npm install @scalar/nextjs-api-referencePut your OpenAPI description in public/openapi.json and create:
// app/scalar/route.ts
import { ApiReference } from '@scalar/nextjs-api-reference'
export const GET = ApiReference({ url: '/openapi.json' })Open /scalar. To embed Scalar in your application layout, follow the App Router page guide.
Changelog
See CHANGELOG.md for a list of changes.
Community
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.
