Skip to main content

Event frontmatter API

Overview

Events are just markdown files, with this comes the use of Content, MDX components and also front-matter.

Here is an example of the event frontmatter you will find in your /events folder.

/events/InventoryOutOfStock/index.mdx (example)
---
# id of your event, used for slugs and references in EventCatalog.
id: InventoryOutOfStock

# Display name of the event, rendered in EventCatalog
name: Out of stock

# Version of the event
version: 0.0.3

# Short summary of your event
summary: |
Event that is raised when an inventory item goes out of stock.

# Optional owners, references teams or users
owners:
- dboyne

repository:
language: JavaScript
url: https://github.com/event-catalog/pretend-shipping-service

# Optional badges, rendered to UI by EventCatalog
badges:
- content: New event
backgroundColor: blue
textColor: blue
# Optional link to display (optional)
link: https://github.com/event-catalog/pretend-shipping-service
---

## Overview

Event is published when the inventory is out of stock.

<NodeGraph />

Required fields

id

  • Type: string

Unqiue id of the event. EventCatalog uses this for references and slugs.

Example
---
id: InventoryOutOfStock
---

name

  • Type: string

Name of the event this is used to display the name on the UI.

Example
---
name: Out of stock
---

version

  • Type: string

Version of the event.

Example
---
version: 0.0.1
---

Optional fields

summary

Short summary of your event, shown on event summary pages.

Example
---
summary: |
Event that is raised when an inventory item goes out of stock.
---

owners

An array of user ids that own the event.

Example
---
owners:
- dboyne
- mSmith
---

badges

An array of badges that get rendered on the page.

Example
---
badges:
- content: My badge
backgroundColor: blue
textColor: blue
# Optional icon to display (from https://heroicons.com/)
# Or the name of the broker (e.g Kafka, EventBridge, etc)
icon: BoltIcon
---

specifications

You can assign one or more specifications to a event.

Example
---
specifications:
- type: asyncapi
path: order-service-asyncapi.yaml
name: AsyncAPI Specification
- type: openapi
path: openapi.yml
name: OpenAPI Specification
---
PropertyTypeRequiredDescription
typestringYesThe type of specification, currently only asyncapi and openapi are supported
pathstringYesThe path to the specification file
namestringNoOptional friendly name of the specification, rendered in the UI

Older versions of EventCatalog (< 2.39.0)

If you are using an older version of EventCatalog you will need to use the following syntax.

Example
---
specifications:
asyncapiPath: order-service-asyncapi.yaml
openapiPath: openapi.yml
---

repository

Repository language and code url for the event.

Example
---
repository:
language: JavaScript
url: https://github.com/event-catalog/pretend-shipping-service
---

Configure the event label and message in the docs sidebar.

Example
---
sidebar:
badge: Event
label: Inventory Adjusted
---

visualiser

Turn off the visualiser for this resource. This means the resource will not be included in the visualiser or the navigation bar for the visualiser.

Default: true

Example
---
visualiser: false
---