Installation
The AsyncAPI plugin is used to generate a catalog from an AsyncAPI specification files.
You can map your AsyncAPI files to commands, events and queries in your catalog, and assign these to services and domains.
Installation
Run the command below to install the EventCatalog AsyncAPI plugin.
- Install on existing catalog
- Create new catalog with AsyncAPI plugin
npm i @eventcatalog/generator-asyncapi
npx @eventcatalog/create-eventcatalog@latest my-catalog --template asyncapi
Configuration
Configure the plugin in your eventcatalog.config.js file.
Add the plugin to the generators array.
// ...
generators: [
// Add single AsyncAPI file to a domain
[
'@eventcatalog/generator-asyncapi',
{
services: [
{ path: path.join(__dirname, 'asyncapi-files', 'orders-service.yml'), id: "Orders Service"}
],
domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
// Run in debug mode, for extra output, if your AsyncAPI fails to parse, it will tell you why
debug: true
},
],
// Add many AsyncAPI files to a domain
[
'@eventcatalog/generator-asyncapi',
{
services: [
// Add AsyncAPI file by URL
{ path: "https://raw.githubusercontent.com/event-catalog/eventcatalog-asyncapi-example/refs/heads/main/asyncapi-files/payment-service.yml", id: "Payment Service"}
// Add AsyncAPI file using file system
{ path: path.join(__dirname, 'asyncapi-files', 'fraud-detection-service.yml'), "Fraud Service"}
],
domain: { id: 'payment', name: 'Payment', version: '0.0.1' },
// Run in debug mode, for extra output, if your AsyncAPI fails to parse, it will tell you why
debug: true
},
],
],
};
Licensing
The EventCatalog AsyncAPI plugin is open source under the MIT License and doesn't need a license key.
If your config still sets licenseKey or an EVENTCATALOG_LICENSE_KEY_* variable, you can remove it; it's ignored.
Run the plugin
This command will run the generators in your eventcatalog.config.js file.
npm run generate
View your catalog
Run your catalog locally to see the changes
npm run dev
Any questions or need help?
If you get stuck, find an issue or need help, please raise an issue on GitHub or join our Discord community.