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

getEvent

Callable

  • getEvent(directory: string): (id: string, version?: string) => Promise<Event>

  • Returns an event from EventCatalog.

    You can optionally specify a version to get a specific version of the event

    @example
    import utils from '@eventcatalog/utils';

    const { getEvent } = utils('/path/to/eventcatalog');

    // Gets the latest version of the event
    const event = await getEvent('InventoryAdjusted');

    // Gets a version of the event
    const event = await getEvent('InventoryAdjusted', '0.0.1');