{"_id":"@daniilsv/nestjs-redoc","name":"@daniilsv/nestjs-redoc","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@daniilsv/nestjs-redoc","version":"1.1.0","description":"NestJS ReDoc (Swagger UI Alternative)","keywords":["nestjs","redoc","swagger","swaggerui","openapi"],"repository":{"type":"git","url":"git+https://github.com/daniilsv/nestjs-redoc.git"},"author":{"name":"DVS"},"main":"dist/index.js","private":false,"license":"MIT","scripts":{"prebuild":"rimraf ./dist","build":"tsc -p ./tsconfig.build.json","format":"prettier --write \"./src/**/*.ts\"","format:check":"prettier --check \"./src/**/*.ts\"","lint":"eslint \"./src/**/*.ts\" --fix","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prepublish":"npm run build","publish":"npm publish --access public","test":"jest","test:watch":"jest --watch","sample":"ts-node ./sample/main"},"peerDependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0","@nestjs/swagger":"^7.1.17","reflect-metadata":"^0.1.13"},"dependencies":{"@nestjs/common":"^10.0.0","@nestjs/swagger":"^7.1.17","express-basic-auth":"^1.2.1","express-handlebars":"^7.1.2","joi":"^17.11.0"},"devDependencies":{"@commitlint/cli":"^18.4.4","@commitlint/config-conventional":"^18.4.4","@nestjs/core":"^10.0.0","@nestjs/platform-express":"^10.0.0","@nestjs/platform-fastify":"^10.0.0","@nestjs/testing":"^10.0.0","@types/express":"^4.17.8","@types/express-handlebars":"^3.1.0","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/node":"^14.14.6","@types/supertest":"^2.0.10","@typescript-eslint/eslint-plugin":"^4.6.1","@typescript-eslint/parser":"^4.6.1","commitizen":"^4.2.2","eslint":"^7.12.1","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.3.0","jest":"^26.6.3","prettier":"^2.1.2","reflect-metadata":"^0.1.13","rimraf":"^3.0.2","rxjs":"^7.8.1","supertest":"^6.0.1","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.3.5"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"_id":"@daniilsv/nestjs-redoc@1.1.0","gitHead":"d245e8ff2c9999587cba334661ff598a49ade7c0","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/daniilsv/nestjs-redoc/issues"},"homepage":"https://github.com/daniilsv/nestjs-redoc#readme","_nodeVersion":"23.8.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Hhnos8nCCQ7oVfEsa+uVQEmT+5mY3qcmPL1S5cXbtxhpjlG0tgmiUerI+1OI9Wk61gwCEJkr02/br1Bbr03niQ==","shasum":"30733d6736e3e57b16d4303d71e3922732f2bc8b","tarball":"https://registry.npmjs.org/@daniilsv/nestjs-redoc/-/nestjs-redoc-1.1.0.tgz","fileCount":33,"unpackedSize":164059,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDjQ0FHRBC43lt8xlP0mfej1QbLWD1h8ufOGfxUMqs/BgIhAI5lPHPgga4qCq/XZJ6OIMP1BIsQSRPX8vyX5eDziv7A"}]},"_npmUser":{"name":"daniilsv","email":"daniilsvin@gmail.com","actor":{"name":"daniilsv","email":"daniilsvin@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"daniilsv","email":"daniilsvin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-redoc_1.1.0_1751372496390_0.20012455242809235"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-01T12:21:36.310Z","1.1.0":"2025-07-01T12:21:36.580Z","modified":"2025-07-01T12:21:36.812Z"},"maintainers":[{"name":"daniilsv","email":"daniilsvin@gmail.com"}],"description":"NestJS ReDoc (Swagger UI Alternative)","homepage":"https://github.com/daniilsv/nestjs-redoc#readme","keywords":["nestjs","redoc","swagger","swaggerui","openapi"],"repository":{"type":"git","url":"git+https://github.com/daniilsv/nestjs-redoc.git"},"author":{"name":"DVS"},"bugs":{"url":"https://github.com/daniilsv/nestjs-redoc/issues"},"license":"MIT","readme":"## NestJS ReDoc (Swagger UI Alternative) - DVS Version\n\n## Introduction\n\nI have tried most of the Redoc integrate NestJS solutions available on the market, but due to a lack of maintenance over a long period, many outdated packages were being used, leading to installation failures. This version has been modified and improved, allowing for perfect integration with NestJS 10.0.0\n\n-Jozefazz\n\n## Features\n\n- Customizable theme\n- It's almost a drop in replacement for you current swagger UI, you only need to import this package and modify any settings you may want to change (e.g: Page title, ReDoc options)\n\nNB: Please read the [ReDoc](https://redocly.com/docs/redoc/) Documentation firstly.\n\n## 🗿 Installation\n\nUsing npm: `npm install @jozefazz/nestjs-redoc`\n\n## How to use\n\nYou need to install the [Swagger Module](https://github.com/nestjs/swagger) first if you want to get definitions updated with your project.\n\nIn future versions you will be able to pass a URL parameter as document, but for the moment you need this document object from the swagger module\n\n```typescript\nconst options = new DocumentBuilder()\n  .setTitle('Look, i have a title')\n  .setDescription('A very nice description')\n  .setBasePath('/api/v1')\n  .build();\nconst document = SwaggerModule.createDocument(app, options);\n```\n\nThen add the following example code.\n\n**Note**: All properties are optional, if you don't specify a title we will fallback to the one you used in your DocumentBuilder instance.\n\n```typescript\nconst redocOptions: RedocOptions = {\n  title: 'Hello Nest',\n  logo: {\n    url: 'https://redocly.github.io/redoc/petstore-logo.png',\n    backgroundColor: '#F0F0F0',\n    altText: 'PetStore logo'\n  },\n  sortPropsAlphabetically: true,\n  hideDownloadButton: false,\n  hideHostname: false,\n  auth: {\n    enabled: true,\n    user: 'admin',\n    password: '123'\n  },\n  tagGroups: [\n    {\n      name: 'Core resources',\n      tags: ['cats'],\n    },\n  ],\n};\n// Instead of using SwaggerModule.setup() you call this module\nawait RedocModule.setup('/docs', app, document, redocOptions);\n```\n\n### You can build a function for the setup\n\nCreate a file \"setup.redoc.ts\"\n\n```typescript\nimport type { INestApplication } from '@nestjs/common';\nimport { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';\nimport { RedocModule, RedocOptions } from '@jozefazz/nestjs-redoc';\nimport * as process from 'process';\n\nexport async function setupRedoc(app: INestApplication) {\n  const documentBuilder = new DocumentBuilder()\n    .setTitle(`${process.env.DOCS_TITLE}`)\n    .setVersion('1.0')\n    .setDescription('Powered by Jozefazz')\n    .addBearerAuth(\n      {\n        description: `Please enter token in following format: Bearer <JWT>`,\n        name: 'Authorization',\n        bearerFormat: 'Bearer',\n        scheme: 'Bearer',\n        type: 'http',\n        in: 'Header',\n      },\n      'access-token',\n    );\n\n  if (process.env.API_VERSION) {\n    documentBuilder.setVersion(process.env.API_VERSION);\n  }\n\n  const document = SwaggerModule.createDocument(app, documentBuilder.build());\n  const redocOptions: RedocOptions = {\n    title: `${process.env.DOCS_TITLE}`,\n    logo: {\n      url: `${process.env.DOCS_LOGO}`,\n      backgroundColor: '#d0e8c5',\n      altText: 'LOGO',\n    },\n    theme: {\n      typography: {\n        fontSize: '16px',\n        fontWeightBold: '900',\n      },\n      sidebar: {\n        backgroundColor: '#d0e8c5',\n      },\n      rightPanel: {\n        backgroundColor: '#01312b',\n      },\n    },\n    sortPropsAlphabetically: true,\n    hideDownloadButton: false,\n    hideHostname: false,\n    noAutoAuth: true,\n    pathInMiddlePanel: true,\n    auth: {\n      enabled: true,\n      user: 'admin',\n      password: `${process.env.DOCS_PASSWORD}`,\n    },\n    tagGroups: [\n      {\n        name: 'Core resources',\n        tags: ['authentication', 'user'],\n      },\n    ],\n  };\n  await RedocModule.setup('docs', app, document, redocOptions);\n  console.info(\n    `Redoc Documentation: http://localhost:${process.env.PORT}/docs`,\n  );\n}\n\n```\n\nIn your main.ts, add this line before \"await app.listen(3000);\"\n\n```\nawait setupRedoc(app);\n```\n\n## Available options\n\n### Redoc Options\n\n| Option                  | Description                                                                                                                                           | Type              | Note                                       |\n| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------ |\n| title                   | Web site title (e.g: ReDoc documentation)                                                                                                             | string            |                                            |\n| favicon                 | Web site favicon URL                                                                                                                                  | string            | Fallbacks to the document title if not set |\n| logo                    | Logo options                                                                                                                                          | LogoOptions       | See LogoOptions table                      |\n| theme                   | Theme options                                                                                                                                         | ThemeOptions      | See ThemeOptions info                      |\n| untrustedSpec           | If set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS, by default is false                                       | boolean           |                                            |\n| supressWarnings         | If set, warnings are not rendered at the top of documentation (they are still logged to the console)                                                  | boolean           |                                            |\n| hideHostname            | If set, the protocol and hostname won't be shown in the operation definition                                                                          | boolean           |                                            |\n| expandResponses         | Specify which responses to expand by default by response codes, values should be passed as comma-separated list without spaces (e.g: 200, 201, \"all\") | string            |                                            |\n| requiredPropsFirst      | If set, show required properties first ordered in the same order as in required array                                                                 | boolean           |                                            |\n| sortPropsAlphabetically | If set, propeties will be sorted alphabetically                                                                                                       | boolean           |                                            |\n| showExtensions          | If set the fields starting with \"x-\" will be shown, can be a boolean or a string with names of extensions to display                                  | boolean           |                                            |\n| noAutoAuth              | If set, redoc won't inject authentication section automatically                                                                                       | boolean           |                                            |\n| pathInMiddlePanel       | If set, path link and HTTP verb will be shown in the middle panel instead of the right one                                                            | boolean           |                                            |\n| hideLoading             | If set, loading spinner animation won't be shown                                                                                                      | boolean           |                                            |\n| nativeScrollbars        | If set, a native scrollbar will be used instead of perfect-scroll, this can improve performance of the frontend for big specs                         | boolean           |                                            |\n| hideDownloadButton      | This will hide the \"Download spec\" button, it only hides the button                                                                                   | boolean           |                                            |\n| disableSearch           | If set, the search bar will be disabled                                                                                                               | boolean           |                                            |\n| onlyRequiredInSamples   | Shows only required fileds in request samples                                                                                                         | boolean           |                                            |\n| auth                    | Auth options                                                                                                                                          | AuthOptions       | See AuthOptions info                       |\n| AuthOptions info        |                                                                                                                                                       |                   |                                            |\n| enabled                 | If enabled, a prompt will pop out asking for authentication details, default:`false`                                                                | boolean           |                                            |\n| user                    | User name, default:`admin`                                                                                                                          | string            |                                            |\n| password                | User password, default:`123`                                                                                                                        | string            |                                            |\n| tagGroups               | Tag groups options                                                                                                                                    | TagGroupOptions[] | See Tag Group options                      |\n| Tag Group options info  |                                                                                                                                                       |                   |                                            |\n| name                    | Tag name                                                                                                                                              | string            |                                            |\n| tags                    | Tag collection                                                                                                                                        | string[]          |                                            |\n| redocVersion            | Set an specific redoc version                                                                                                                         | string,number     | By default it's \"latest\"                   |\n\n**Note**: If you want to change your ReDoc theme settings, take a look at the official ReDoc documentation: [https://github.com/Redocly/redoc/blob/master/src/theme.ts](https://github.com/Redocly/redoc/blob/master/src/theme.ts)\n\nApply the properties defined in ResolvedThemeInterface to the key called \"theme\" in the redoc options\n\n### Logo options\n\n| Option          | Description                                                                           | Type   | Example  |\n| --------------- | ------------------------------------------------------------------------------------- | ------ | -------- |\n| url             | The URL pointing to the spec Logo, must be in the format of a URL and an absolute URL | string |          |\n| backgroundColor | Background color to be used, must be RGB color in hexadecimal format (e.g: #008080)   | string | #F0F0F0  |\n| altText         | Alt tag for Logo                                                                      | string | PetStore |\n| href            | href tag for Logo, it defaults to the host used for your API spec                     | string |          |\n\n### Special Thanks\n\nForked from https://github.com/ojoanalogo/nestjs-redoc\n","readmeFilename":"README.md","_rev":"1-17b9272aba1d2bcda8257b0bec91e8b7"}