Skip to main content

Plugin Configuration

Overview

The EventCatalog AsyncAPI plugin is configured in the eventcatalog.config.js file inside the generators array.

Required Configuration Options

OptionTypeRequiredDescription
servicesService[]YesList of AsyncAPI files to add to your catalog
licenseKeystringYes*License key for the plugin. Get a 14-day trial at EventCatalog Cloud. Can also be set via EVENTCATALOG_LICENSE_KEY_ASYNCAPI environment variable.

Service Configuration

Each service in the services array requires the following properties:

PropertyTypeRequiredDescription
idstringYesEventCatalog ID for the service.
pathstringYesPath to your AsyncAPI file or remote URL to the AsyncAPI file
ownersstring[]NoOwners of the service. You can assign EventCatalog users or teams to services. Setting owners on the service will also set the owners of the messages in the AsyncAPI file. If owners are already set on any resource, those owners are persisted.

Optional Configuration Options

OptionTypeDefaultDescription
domainobject-Domain to associate all configured services with
domain.idstring-Domain identifier
domain.namestring-Domain display name
domain.versionstring-Domain version
domain.ownersstring[]-Owners of the domain. If owners are already set on the domain, those owners are persisted.
saveParsedSpecFilebooleanfalseParse and save expanded AsyncAPI spec (helpful for files with $refs)
parseSchemasbooleantrueIf you choose to parse your specification file using the saveParsedSpecFile field, you can also opt in or out to have your ,message schemas parsed using the parseSchemas field. By default message schemas are parsed, if you want to keep your original schemas you have to set parseSchemas to false.
writeFilesToRootbooleanfalseWrite AsyncAPI messages to root instead of service folder. By default all domains, services and messages will be grouped in the folder directory structure.
saveParsedSpecFilebooleantrueBy default your AsyncAPI file will render in your catalog as you define it. If you are using $refs, or having issues seeing your AsyncAPI file in your catalog, then you can set this value to true. saveParsedSpecFile is false by default.
debugbooleanfalseEnable debug mode

Example Configuration

eventcatalog.config.js
import path from "path";
import url from "url";

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
export default {
cId: "10b46030-5736-4600-8254-421c3ed56e47",
title: "MetaRetail Inc",
tagline: "Fake Retail Company for EventCatalog Demo",
organizationName: "MetaRetail Inc",
homepageLink: "https://eventcatalog.dev/",
editUrl: "https://github.com/boyney123/eventcatalog-demo/edit/master",
// By default set to false, add true to get urls ending in /
trailingSlash: false,
// Change to make the base url of the site different, by default https://{website}.com/docs,
// changing to /company would be https://{website}.com/company/docs,
base: "/",
// Customize the logo, add your logo to public/ folder
logo: {
alt: "EventCatalog Logo",
src: "/logo.png",
text: "MetaRetail Inc",
},
docs: {
sidebar: {
// Should the sub heading be rendered in the docs sidebar?
showPageHeadings: true,
},
},
generators: [
[
'@eventcatalog/generator-asyncapi',
{
services: [
{ path: path.join(__dirname, 'asyncapi-files', 'orders-service.yml'), id: 'Orders Service' },
{ path: path.join(__dirname, 'asyncapi-files', 'order-fulfillment-service.yml'), id: 'Order Fulfillment' },
{ path: path.join(__dirname, 'asyncapi-files', 'inventory-service.yml'), id: 'Inventory Service' },
],
domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
},
],
[
'@eventcatalog/generator-asyncapi',
{
services: [
// Add AsyncAPI file by public 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 by file system
{ path: path.join(__dirname, 'asyncapi-files', 'fraud-detection-service.yml'), id: 'Fraud Detection' },
],
domain: { id: 'payment', name: 'Payment', version: '0.0.1' },
},
],
[
'@eventcatalog/generator-asyncapi',
{
services: [
{ path: path.join(__dirname, 'asyncapi-files', 'user-service.yml'), id: 'User Service' },
],
domain: { id: 'user-domain', name: 'User Domain', version: '0.0.1' },
debug: true
},
],
],
};

You can view an example configuration in the EventCatalog AsyncAPI plugin GitHub repository.

Need help?

If you have questions or need help, you can join our Discord community or refer to the AsyncAPI examples on GitHub.