{"id":13554847,"url":"https://github.com/flamewow/nestjs-asyncapi","last_synced_at":"2025-05-15T09:08:44.806Z","repository":{"id":37055557,"uuid":"397581124","full_name":"flamewow/nestjs-asyncapi","owner":"flamewow","description":"NestJS AsyncAPI module - generate documentation of your event-based services using decorators","archived":false,"fork":false,"pushed_at":"2025-05-14T08:35:33.000Z","size":24677,"stargazers_count":210,"open_issues_count":28,"forks_count":35,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-14T09:45:17.421Z","etag":null,"topics":["asyncapi","nest","nestjs","openapi","swagger"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flamewow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-18T11:47:19.000Z","updated_at":"2025-05-13T11:46:43.000Z","dependencies_parsed_at":"2023-09-23T04:11:14.411Z","dependency_job_id":"8ccfd3ce-423c-4184-a922-f2256f1a93a9","html_url":"https://github.com/flamewow/nestjs-asyncapi","commit_stats":{"total_commits":524,"total_committers":12,"mean_commits":"43.666666666666664","dds":0.5534351145038168,"last_synced_commit":"0066bf8940f0e747bbd464bb077c9b8737a22920"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamewow%2Fnestjs-asyncapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamewow%2Fnestjs-asyncapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamewow%2Fnestjs-asyncapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamewow%2Fnestjs-asyncapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flamewow","download_url":"https://codeload.github.com/flamewow/nestjs-asyncapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254138841,"owners_count":22021070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncapi","nest","nestjs","openapi","swagger"],"created_at":"2024-08-01T12:02:56.091Z","updated_at":"2025-05-15T09:08:39.798Z","avatar_url":"https://github.com/flamewow.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"## Description\n\n[AsyncApi](https://www.asyncapi.com/) module for [Nest](https://github.com/nestjs/nest).\n\nGenerate [AsyncApi](https://www.asyncapi.com/) documentation (for event-based services, like websockets) in a similar\nto [nestjs/swagger](https://github.com/nestjs/swagger) fashion.\n\n### [Live Preview](https://flamewow.github.io/nestjs-asyncapi/live-preview)\n\n[AsyncApi playground](https://playground.asyncapi.io/?load=https://raw.githubusercontent.com/asyncapi/asyncapi/v2.1.0/examples/simple.yml)\n\n## Installation\n\nfull installation (with chromium)\n\n```bash\n$ npm i --save nestjs-asyncapi\n```\n\nnestjs-async api package doesn't require chromium (which is required by asyncapi lib), so u can skip chromium\ninstallation by setting PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true environment variable.\n\n```bash\n$ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i --save nestjs-asyncapi\n```\n\n## Quick Start\n\nInclude AsyncApi initialization into your bootstrap function.\n\n```typescript\nasync function bootstrap() {\n    const app = await NestFactory.create\u003cNestExpressApplication\u003e(AppModule);\n\n    const asyncApiOptions = new AsyncApiDocumentBuilder()\n        .setTitle('Feline')\n        .setDescription('Feline server description here')\n        .setVersion('1.0')\n        .setDefaultContentType('application/json')\n        .addSecurity('user-password', {type: 'userPassword'})\n        .addServer('feline-ws', {\n            url: 'ws://localhost:3000',\n            protocol: 'socket.io',\n        })\n        .build();\n\n    const asyncapiDocument = await AsyncApiModule.createDocument(app, asyncApiOptions);\n    await AsyncApiModule.setup(docRelPath, app, asyncapiDocument);\n\n    // other bootstrap procedures here\n\n    return app.listen(3000);\n}\n```\n\nAsyncApi module explores `Controllers` \u0026 `WebSocketGateway` by default.\nIn most cases you won't need to add extra annotation,\nbut if you need to define asyncApi operations in a class that's not a controller or gateway use the `AsyncApi` class\ndecorator.\n\nMark pub/sub methods via `AsyncApiPub` or `AsyncApiSub` decorators\u003cbr/\u003e\n\n```typescript\nclass CreateFelineDto {\n    @ApiProperty()\n    demo: string;\n}\n\n@Controller()\nclass DemoController {\n    @AsyncApiPub({\n        channel: 'create/feline',\n        message: {\n            payload: CreateFelineDto\n        },\n    })\n    async createFeline() {\n        // logic here\n    }\n\n    @AsyncApiSub({\n        channel: 'create/feline',\n        message: {\n            payload: CreateFelineDto\n        },\n    })\n    async createFeline() {\n        // logic here\n    }\n}\n\n```\n\nFor more detailed examples please check out https://github.com/flamewow/nestjs-asyncapi/tree/main/sample sample app.\n\n\u003ch5\u003eDo you use this library and like it? Don't be shy to give it a star\non \u003ca href=\"https://github.com/flamewow/nestjs-asyncapi\"\u003egithub \u003cspan\u003e★\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamewow%2Fnestjs-asyncapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflamewow%2Fnestjs-asyncapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamewow%2Fnestjs-asyncapi/lists"}