Skip to main content
New project sponsor 🪝Hookdeck: Serverless infrastructure for event-driven architecture. Learn more.

Announcing the new EventCatalog SDK

· 2 min read
David Boyne
Founder of EventCatalog

I'm excited to announce the release of the new JavaScript/TypeScript EventCatalog SDK. This SDK is designed to help users programmatically interact with their EventCatalogs, streamlining the process of managing event-driven architectures.

EventCatalog aims to facilitate the discovery and documentation of event-driven architectures, regardless of the broker or technology used. The EventCatalog SDK is a step towards this vision.

Many EventCatalog users have requested integration support and automation capabilities (i.e GitHub Actions). With this SDK, we are starting to provide these options. Future releases will include broker integrations and plugins, expanding the SDK's functionality.

The new SDK enables CRUD operations on your domains, services, and messages within your Catalog. Additionally, it allows you to add files and schemas to these resources, enhancing your ability to manage and document your event-driven architecture efficiently.

Getting Started

First, install the SDK by running:

pnpm add @eventcatalog/sdk

Next, you need to initialize the SDK with the location of your catalog:

import utils from '@eventcatalog/sdk';

// tell utils where your EventCatalog path is
const { getEvent, writeEvent, versionEvent, rmEventById } = utils('/my-eventcatalog');

// Write an event to EventCatalog (this would go to events/InventoryAdjusted)
await writeEvent({
id: 'InventoryAdjusted',
name: 'Inventory Adjusted',
summary: 'Event raised when inventory has been adjusted',
version: '1.0.0',
markdown: `## Overview
Inventory Adjusted is triggered when the inventory has been changed.
<NodeGraph />
`
})

// Get an event based on it's ID
const event = await getEvent('InventoryAdjusted');

// Get an event based on its ID and version
const event = await getEvent('InventoryAdjusted', '0.0.1');

// Take the latest event and version it
await versionEvent('InventoryAdjusted');

// Remove the event from EventCatalog
await rmEventById('InventoryAdjusted');

You can find the complete documentation for the SDK on our documentation website.

What's next?

We will continue to add new features to the SDK, with a major focus on open-source plugins and broker integrations.

A variety of open-source EventCatalog plugins will be developed, along with a CLI to create new plugins. EventCatalog will support configuration with both custom and off-the-shelf plugins, allowing integration with schema registries, AsyncAPI files, and more.

If you have any questions, feature ideas, or would like to discuss EventCatalog features with your team, join our Discord community.