Skip to content
Plugin
Redoc logo
plugins: [pluginRedoc()]
Officialv5.2.5kubb >=5.19.0node >=22.22

OpenAPI to Redoc documentation generator

@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.

kubb add plugin-redoc
redocapi-docsdocumentationinteractive-docscodegenopenapi

The Redoc plugin generates one Redoc HTML page with your OpenAPI spec embedded. Publish it to any static host without a build step.

Viewing the page needs network access. It loads a pinned Redoc bundle from jsDelivr, checked with a Subresource Integrity hash, and its fonts from Google Fonts.

Installation

kubb add plugin-redoc

kubb add installs the version the Kubb registry pins and adds pluginRedoc() to kubb.config.ts. It needs a kubb.config.ts, so run kubb init first in a new project.

Setup

No other plugins or packages are needed. The plugin needs the default OpenAPI adapter, adapterOas, and fails with KUBB_ADAPTER_REQUIRED for any other adapter.

Options worth knowing

OptionDefaultWhat it does
output.path'docs.html'Path of the HTML file, relative to the root output.path. End it with .html, because it names a file.

The plugin has no other options.

Example

This config writes the page to src/gen/docs.html, titled with the spec's info.title.

import { defineConfig } from 'kubb/config'
import { pluginRedoc } from '@kubb/plugin-redoc'

export default defineConfig({
  input: './petStore.yaml',
  output: { path: './src/gen' },
  plugins: [
    pluginRedoc({ output: { path: 'docs.html' } }),
  ],
})

Dependencies

No extension dependencies.