# @typebot.io/docusaurus-preset-openapi

> OpenAPI preset for Docusaurus.

Latest version **0.6.5** (published 2022-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @typebot.io/docusaurus-preset-openapi
pnpm add @typebot.io/docusaurus-preset-openapi
yarn add @typebot.io/docusaurus-preset-openapi
bun add @typebot.io/docusaurus-preset-openapi
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.5 |
| Published | 2022-11-28 |
| First published | 2022-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 4 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 536 |
| Maintainers | baptistearnaud |
| Keywords | openapi, swagger, docusaurus, documentation, react |

## Links

- npm: https://www.npmjs.com/package/@typebot.io/docusaurus-preset-openapi
- Repository: https://github.com/cloud-annotations/docusaurus-openapi
- Homepage: https://github.com/cloud-annotations/docusaurus-openapi#readme
- Issues: https://github.com/cloud-annotations/docusaurus-openapi/issues
- npm.io page: https://npm.io/package/@typebot.io/docusaurus-preset-openapi

## Dependencies (4)

- [@docusaurus/preset-classic](https://npm.io/package/@docusaurus/preset-classic.md) ^2.0.0
- [@typebot.io/docusaurus-plugin-proxy](https://npm.io/package/@typebot.io/docusaurus-plugin-proxy.md) ^0.6.5
- [@typebot.io/docusaurus-theme-openapi](https://npm.io/package/@typebot.io/docusaurus-theme-openapi.md) ^0.6.5
- [@typebot.io/docusaurus-plugin-openapi](https://npm.io/package/@typebot.io/docusaurus-plugin-openapi.md) ^0.6.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.6.5 (latest) — 2022-11-28
- 0.6.4 — 2022-11-28

## README

<h1 align="center">Docusaurus OpenAPI</h1>

<div align="center">

OpenAPI plugin for generating API reference docs in Docusaurus v2.

</div>

<p align="center">

![](https://user-images.githubusercontent.com/4212769/85324376-b9e3d900-b497-11ea-9765-c42a8ad1ff61.png)

</p>

## Installation

Install the preset in your docusaurus project by running:

```sh
// with npm
npm install docusaurus-preset-openapi

// with yarn
yarn add docusaurus-preset-openapi
```

## Usage

1. Add your OpenAPI definition to the root of your site dir as `openapi.json` (See [Configuration](#Configuration) options below).

2. The OpenAPI preset can be used as a drop-in replacement for `@docusaurus/preset-classic`, replace it as follows:

   ```js
   /* docusaurus.config.js */

   {
     presets: [
       [
         "docusaurus-preset-openapi",
         {
           // docs: { ... },
           // blogs: { ... },
           // theme: { ... },
         },
       ],
     ],
   }
   ```

3. Add a link to the API section of your site by updating `themeConfig.navbar.items`:

   ```js
   /* docusaurus.config.js */

   {
     themeConfig: {
       navbar: {
         items: [
           // ... other items
           { to: "/api", label: "API", position: "left" },
           // ... other items
         ],
       },
     },
   }
   ```

## Configuration

The OpenAPI plugin can be configured with the following options:

| Name                         | Type      | Default            | Description                                                                                                                  |
| ---------------------------- | --------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `path`                       | `string`  | `'openapi.json'`   | Path to OpenAPI definition (`json` or `yaml`) on filesystem relative to site dir.                                            |
| `routeBasePath`              | `string`  | `'api'`            | URL route for the API section of your site. **DO NOT** include a trailing slash. Use `/` for shipping API without base path. |
| `sidebarCollapsible`         | `boolean` | `true`             | Whether sidebar categories are collapsible by default.                                                                       |
| `sidebarCollapsed`           | `boolean` | `true`             | Whether sidebar categories are collapsed by default.                                                                         |
| `apiLayoutComponent`         | `string`  | `'@theme/ApiPage'` | Root Layout component of each API page.                                                                                      |
| `apiItemComponent`           | `string`  | `'@theme/ApiItem'` | Main API container, with demo panel, pagination, etc.                                                                        |
| `remarkPlugins`              | `any[]`   | `[]`               | Remark plugins passed to MDX.                                                                                                |
| `rehypePlugins`              | `any[]`   | `[]`               | Rehype plugins passed to MDX.                                                                                                |
| `beforeDefaultRemarkPlugins` | `any[]`   | `[]`               | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins.                                            |
| `beforeDefaultRehypePlugins` | `any[]`   | `[]`               | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins.                                            |

Example:

```js
/* docusaurus.config.js */

{
  presets: [
    [
      "docusaurus-preset-openapi",
      {
        api: {
          path: "api/cars.yaml",
          routeBasePath: "cars",
          // ... other options
        }
      },
    ],
  ],
}
```

---
_Source: https://npm.io/package/@typebot.io/docusaurus-preset-openapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
