Plugins
API Docs
Mount interactive API reference documentation powered by Scalar.
API Docs
Mounts an interactive Scalar API reference UI that renders an OpenAPI spec.
Installation
bun add @manicjs/api-docsUsage
// manic.config.ts
import { } from 'manicjs/config';
import { } from '@manicjs/api-docs';
export default ({
: [
(),
],
});This serves the Scalar docs UI at /docs, loading the OpenAPI spec from /openapi.json.
The plugin does not generate an OpenAPI spec. You must provide the spec yourself — for example, via an API route that returns your spec as JSON at /openapi.json.
Options
Prop
Type
Custom Configuration
import { } from 'manicjs/config';
import { } from '@manicjs/api-docs';
export default ({
: [
({
: '/api-reference',
: '/api/spec.json',
: 'modern',
}),
],
});Limitations
This plugin only has a configureServer hook — it does not include a build hook. The docs UI is available in development but is not included in production builds.
See Also
- Scalar — API documentation tool
- OpenAPI Specification