# swagger-ui-dist

> [![NPM version](https://badge.fury.io/js/swagger-ui-dist.svg)](http://badge.fury.io/js/swagger-ui-dist)

Latest version **5.32.15** (published 2026-09-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install swagger-ui-dist
pnpm add swagger-ui-dist
yarn add swagger-ui-dist
bun add swagger-ui-dist
```

## Health

**Score 68/100 (B)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo.

Warnings: low downloads; no esm support; large bundle.

## Facts

| | |
|---|---|
| Version | 5.32.15 |
| Published | 2026-09-04 |
| First published | 2017-04-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/swagger-ui-dist) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 29010 |
| Maintainers | swagger-admin, ponelat, swagger-api, kyleshockey |

## Links

- npm: https://www.npmjs.com/package/swagger-ui-dist
- Repository: https://github.com/swagger-api/swagger-ui
- Homepage: https://github.com/swagger-api/swagger-ui#readme
- Issues: https://github.com/swagger-api/swagger-ui/issues
- npm.io page: https://npm.io/package/swagger-ui-dist

## Dependencies (1)

- [@scarf/scarf](https://npm.io/package/@scarf/scarf.md) =1.4.0

## Recent versions

- 5.32.15 (latest) — 2026-09-04
- 5.0.0-beta.0 (beta) — 2023-06-11
- 5.0.0-alpha.15 (alpha) — 2023-06-05
- 5.32.14 — 2026-08-18
- 5.32.13 — 2026-08-11
- 5.32.12 — 2026-08-03
- 5.32.11 — 2026-07-22
- 5.32.10 — 2026-07-21
- 5.32.9 — 2026-07-17
- 5.32.8 — 2026-06-23
- 5.32.7 — 2026-06-22
- 5.32.6 — 2026-05-12
- 5.32.5 — 2026-04-27
- 5.32.4 — 2026-04-15
- 5.32.3 — 2026-04-14
- … 354 more at https://npm.io/package/swagger-ui-dist/versions

## README

# Swagger UI Dist
[![NPM version](https://badge.fury.io/js/swagger-ui-dist.svg)](http://badge.fury.io/js/swagger-ui-dist)

## Anonymized analytics

SwaggerUI Dist uses [Scarf](https://scarf.sh/) to collect [anonymized installation analytics](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-what-information-does-scarf-js-send-about-me). These analytics help support the maintainers of this library and ONLY run during installation. To [opt out](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-how-can-i-opt-out-of-analytics), you can set the `scarfSettings.enabled` field to `false` in your project's `package.json`:

```
// package.json
{
  // ...
  "scarfSettings": {
    "enabled": false
  }
  // ...
}
```

Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false` as part of the environment that installs your npm packages, e.g., `SCARF_ANALYTICS=false npm install`.


# API

This module, `swagger-ui-dist`, exposes Swagger-UI's entire dist folder as a dependency-free npm module.
Use `swagger-ui` instead, if you'd like to have npm install dependencies for you.

`SwaggerUIBundle` and `SwaggerUIStandalonePreset` can be imported:
```javascript
  import { SwaggerUIBundle, SwaggerUIStandalonePreset } from "swagger-ui-dist"
```

To get an absolute path to this directory for static file serving, use the exported `getAbsoluteFSPath` method:

```javascript
const swaggerUiAssetPath = require("swagger-ui-dist").getAbsoluteFSPath()

// then instantiate server that serves files from the swaggerUiAssetPath
```

For anything else, check the [Swagger-UI](https://github.com/swagger-api/swagger-ui) repository.

---
_Source: https://npm.io/package/swagger-ui-dist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
