Beta You're reading the docs for Kubb v5, which is currently in beta. View the stable v4 docs
Skip to content
Official v5.0.0-beta.84 MIT kubb >=5.0.0 node >=22

@kubb/plugin-redoc

Generates a single-file HTML page from your OpenAPI spec with Redoc, rebuilt on every Kubb run so the docs match the spec your code comes from.

redocapi-docsdocumentationinteractive-docscodegenopenapi
Downloads
34.4k / mo
Stars
3
Bundle size
27.6 kB
Updated
2d ago

@kubb/plugin-redoc

@kubb/plugin-redoc turns your OpenAPI spec into a static HTML documentation page with Redoc. The output is a single file with the spec embedded inline, so you can drop it on any static host without a build step. The page loads the Redoc bundle and fonts from a CDN when viewed, so rendering needs network access.

Kubb rebuilds the file on every run. Your docs stay in step with the spec your code was generated from.

This plugin reads the OpenAPI adapter. Kubb uses adapterOas() by default, so it works out of the box. You set adapter yourself only if you replaced that default with another adapter.

Installation

shell
bun add -d @kubb/plugin-redoc@beta
shell
pnpm add -D @kubb/plugin-redoc@beta
shell
npm install --save-dev @kubb/plugin-redoc@beta
shell
yarn add -D @kubb/plugin-redoc@beta

Example

typescript
import {  } from 'kubb'
import {  } from '@kubb/adapter-oas'
import {  } from '@kubb/plugin-redoc'

export default ({
  : { : './petStore.yaml' },
  : { : './src/gen' },
  : (),
  : [
    ({
      : { : 'docs.html' },
    }),
  ],
})

See also