npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docusaurus-plugin-speccy

v0.13.1

Published

Render elegant OpenAPI reference pages in Docusaurus.

Readme

Speccy for Docusaurus

Speccy adds a clean OpenAPI reference to a Docusaurus 3 site. It can build a full reference route from a local file or a remote URL, and the same renderer can be embedded in MDX with an inline document. The package is published as docusaurus-plugin-speccy.

Install

npm install docusaurus-plugin-speccy

Add the plugin to docusaurus.config.ts:

export default {
  plugins: [
    [
      'docusaurus-plugin-speccy',
      {
        route: '/api',
        spec: './static/openapi.yaml',
        renderer: {
          accentColor: '#6d5dfc',
        },
      },
    ],
  ],
};

The reference is now available at /api. Use specUrl in place of spec to fetch a remote document at build time; the build environment must be able to reach that URL. The plugin also publishes the source document unchanged and links to it from the overview. JSON sources use /api/openapi.json, while YAML sources use /api/openapi.yaml. The link respects the site's baseUrl.

Register the plugin more than once to publish several references. Every instance needs a unique Docusaurus id:

plugins: [
  [
    'docusaurus-plugin-speccy',
    { id: 'payments', route: '/api', spec: './static/payments.yaml' },
  ],
  [
    'docusaurus-plugin-speccy',
    {
      id: 'backoffice',
      route: '/api/backoffice',
      spec: './static/backoffice.yaml',
    },
  ],
];

By default, the plugin builds a static page for the overview, each endpoint, each tag, and each component section. These pages share one copy of the OpenAPI document. For very large references where build speed matters more than server-rendered deep links, use one client-routed page instead:

{
  routeGeneration: 'client',
}

Generated pages use the Docusaurus layout, including its navbar. Statically generated pages carry route-specific title and description metadata; with routeGeneration: 'client', every path serves the overview metadata. The footer is hidden by default so the reference can use the available height. Show it with layout: { noFooter: false }, or set layout: false to render the reference without the Docusaurus page shell.

Add a public Postman collection through the renderer settings:

renderer: {
  postmanCollectionUrl: 'https://www.postman.com/example/collection',
}

Set renderer.openApiUrl only when the description is hosted somewhere else. This overrides the generated link without changing the file emitted by the plugin.

To embed a reference in MDX:

import { OpenAPI } from 'docusaurus-plugin-speccy/client';
import spec from '@site/static/openapi.json';

<OpenAPI spec={spec} />

Embedded references hide their internal sidebar by default. Set showSidebar to add it. Registering the plugin in plugins also loads the renderer stylesheet; when you embed the component without registering the plugin, import docusaurus-plugin-speccy/styles.css once yourself.

Set renderer.tryIt to false on a generated route, or pass tryIt={false} to an embedded OpenAPI component, to hide the request builder and prevent visitors from sending requests.

Link guides to operations

The client entry point also exports four MDX-friendly treatments for linking guide content to an operation:

import {
  EndpointStrip,
  OperationCard,
  OperationLink,
  OperationPreview,
} from 'docusaurus-plugin-speccy/client';

Call <OperationLink method="post" path="/corporates" href="/api/create-corporate" /> to create the identity.

<OperationCard
  method="post"
  path="/corporates"
  summary="Create a corporate identity"
  description="Creates the identity and its root user."
  href="/api/create-corporate"
/>

Use OperationLink inside prose, EndpointStrip for a full-width callout, OperationCard in operation collections, and OperationPreview when the guide should include request and response examples. They use ordinary links, so provide the generated operation URL for the relevant reference.

Speccy follows Docusaurus's selected color mode, typography, and base font size by default. For independent theme controls, set renderer.theme to a value other than inherit, and add renderer.showThemeToggle: true to give visitors a toggle; the toggle only appears when both are set.

Generated references show Speccy's API health guidance during local Docusaurus development and hide it in production builds. Override this with renderer.showDeveloperHints when you need explicit control; note the plugin only runs Spectral during development builds, so forcing hints on in production shows Speccy's own guidance without Spectral findings. You can also pass previousSpec and spectralDiagnostics through the renderer options.