Skip to main content

Installation

View as Markdown

The Apicurio Registry plugin is used to generate a catalog from an Apicurio Registry and import your schemas and specifications into EventCatalog.

You can map your schemas from your Apicurio Registry to events, commands, or queries in your catalog, and assign these to services and domains.

Installation​

Run the command below to install the EventCatalog Apicurio Registry plugin.

"Don't have an EventCatalog project yet?"

If you don't have an EventCatalog project yet, you can follow the instructions in the Getting Started guide.

npm i @eventcatalog/generator-apicurio

Configuration​

To use the plugin you need to configure it in your eventcatalog.config.js file.

Add the plugin to the generators array.

In this example we import all schemas from an Apicurio Registry into EventCatalog.

You can also create services and assign schemas to them, along with domains. (see examples).

eventcatalog.config.js
// ...
generators: [
// 1. Import all schemas from an Apicurio Registry
[
'@eventcatalog/generator-apicurio',
{
// The URL of your Apicurio Registry
registryUrl: 'http://localhost:8080',
// Do you want to include all versions of a schema? (default: false)
includeAllVersions: true
},
],
];

Configure API keys​

The EventCatalog Apicurio Registry 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.

If your Apicurio Registry requires authentication, create a .env file in the root and add your access token to the project.

.env
# Apicurio Registry Bearer Token (optional - only if your registry requires authentication)
APICURIO_ACCESS_TOKEN=your-access-token-here

Run the plugin​

Run the plugin to import your schemas into EventCatalog.

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

Build your catalog for production​

npm run build

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.

You can also find some examples of the plugin in action in our examples repository: eventcatalog/examples.