Skip to main content

Export reference

View as Markdown

Everything about exporting your catalog in one place: the architecture reference and custom exports.

Paths​

Custom exports are files in the exports folder at the root of your catalog, one per export:

/exports/{id}.mdx
/exports/{id}.md

The folder isn't searched recursively. Set exports.custom.dir to use another folder.

Output​

FileStatic buildServer modeHosted at
Architecture referencedist/architecture.htmldist/client/architecture.html/architecture.html
Custom exportdist/exports/{id}.htmldist/client/exports/{id}.html/exports/{id}.html

The CLI writes architecture.html or {id}.html in the folder you run it from, unless you pass --output.

Every file is self-contained: styles, scripts, schemas and specifications are inside it. Only the latest version of each resource is exported, and resources marked as hidden are left out.

Frontmatter​

The frontmatter of a custom export file. Any other field is an error, and every problem in a file is reported at once.

Values are read as text, so version: 2026.10 stays 2026.10.

Required fields​

title​

  • Type: string

The export's title, shown at the top of the page and in link previews.

Example
---
title: Payments for partners
---

include​

What's in the export. A domain or system brings what's inside it.

Example
---
include:
- system: payment-processing-system
- event: payment-succeeded
- x-public: true
---

Optional fields​

id​

  • Type: string
  • Default: the file name, without its extension

The export's id. It names the HTML file and is what you pass to the CLI. Letters, numbers, - and _ only, and unique across the folder.

Example
---
id: payments-for-partners
---

summary​

  • Type: string

A sentence under the title. Also used as the description in link previews.

Example
---
summary: How partners take payment for orders and stay in sync with what happens next.
---

audience​

  • Type: string

Who the export is for, shown under the title.

Example
---
audience: Partners integrating with Acme Checkout
---

version​

  • Type: string

The export's own version, shown at the top of the page.

Example
---
version: 2026.10
---

exclude​

What to take out again. Applied before include, and always wins. Excluding a domain or system takes out everything in it, and an excluded resource is never named in the export.

Example
---
exclude:
- service: payment-worker
- x-internal: true
---

references​

What to show for links to resources that aren't in the export:

ValueWhat's shown
omitNothing. The link is dropped.
name-onlyThe resource's name, without a link.
includeThe resource itself, pulled into the export. One level only: what it points at isn't followed.

Links to excluded resources are always dropped.

Example
---
references: name-only
---

hide​

Fields to leave out of every resource in the export. Set hide: [] to show everything.

ValueWhat it leaves out
ownersWho owns each resource, and what each team or user in the export owns
repositoryWhere a service's code lives
contactsTeam and user email addresses and Slack channels
docsThe resources' own documentation (the body of their pages)
specificationsOpenAPI, AsyncAPI and GraphQL specifications
examplesExample payloads for messages, including the one made from the schema
Example
---
hide: [owners, repository]
---

Body​

The body of the file is the export's introduction, in markdown, shown before the resources. It can link to resources with [[type|id]]. A link to a resource that isn't in the export reads "another service", "another event" and so on, or the resource's name with references: name-only (unless it was excluded).

Selectors​

include, exclude and neverExport are lists of selectors.

By id​

One resource, by its kind and id, with an optional version:

- service: checkout-api
version: 1.x
KeyMatches
domainA domain, with its subdomains, systems, services, entities and flows, and the messages its services send and receive
systemA system, with its services, data stores, entities and flows, and the messages its services send and receive
serviceA service, or an agent with that id when no service has it
agentAn agent
event, command, queryA message of that kind
messageAn event, command or query with that id
channelA channel
data-store (or container)A data store
flowA flow
entityAn entity
team, userA team or a user

version is an exact version or a semver range. Only the latest version of each resource is exported, so it must match the latest one.

By custom property​

Every resource with custom properties that have the given values:

- x-operational-tier: [1, 2]
kind: [service, agent]
KeyDescription
x-…A custom property, and the value (or list of values) it must have. Every x- key in a selector must match.
kindOptional. One kind, or a list of them, from the table above.
  • Values are compared as text: true matches true and "true", and 1 matches 1 and "1".
  • A resource's list matches when any of its items does.
  • Objects can't be matched.
  • A selector can't also name a resource by id, or take a version.

Configuration​

exports.html​

OptionTypeDefaultDescription
exports.html.enabledbooleantrue (false with authentication)Write the architecture reference when you build.

exports.custom​

OptionTypeDefaultDescription
exports.custom.enabledbooleantrue (false with authentication)Write the custom exports when you build.
exports.custom.dirstring'exports'The folder with your custom export files, relative to your catalog.
exports.custom.onlystring[]Build only these custom exports, by id. The CLI can still export any of them.
exports.custom.defaults.hidestring[]['owners', 'repository', 'contacts', 'docs']What every custom export hides, unless it sets its own hide.
exports.custom.defaults.referencesstring'omit'What every custom export shows for links out of it, unless it sets its own.
exports.custom.neverExportobject[]Selectors for resources no custom export may show, whatever it includes.

When exports are written​

Your catalogenabled not settruefalse
Without authenticationWrittenWrittenNot written
With authenticationNot writtenWrittenNot written

Files in the build output are served without the authentication checks, so catalogs with authentication must turn exports on. Custom exports are only looked for when the folder has .md or .mdx files.

Each custom export is written on its own. One with a problem (a field that isn't valid, an id another file uses too, or nothing in it) is skipped with a warning in the build's output, and the others are still written. The build doesn't fail.

Example​

eventcatalog.config.js
module.exports = {
exports: {
html: {
enabled: true,
},
custom: {
only: ['partner-payments', 'personal-data'],
defaults: {
hide: ['owners', 'repository', 'contacts', 'docs'],
references: 'omit',
},
neverExport: [
{ service: 'fraud-detection' },
{ 'x-data-classification': ['confidential', 'restricted'] },
],
},
},
};

See the full configuration reference for every EventCatalog option.

CLI​

Run the export command of the EventCatalog CLI from the root of your catalog:

# The architecture reference
npx @eventcatalog/cli export --format html

# A custom export, by id
npx @eventcatalog/cli export partner-payments

# What's in a custom export, without writing it
npx @eventcatalog/cli export partner-payments --check
OptionDescription
<id>The custom export to write. Leave it out, with --format html, for the architecture reference.
--format htmlExport as HTML. Not needed with an id.
--checkWith an id: list what's in the export, what was left out and why, without writing it.
--output <path>Where to write the file. Defaults to architecture.html or <id>.html
--no-openDon't open the file in your browser. It's never opened in CI, or when the output isn't a terminal.
--stdoutPrint the HTML instead of writing a file.
--dir <path>Path to your catalog, if you aren't running the command from it.

The command exits with 1 when an export has a problem (an unknown id, or a field that isn't valid), and when --check finds a selector that matches nothing in the catalog.

Check output​

--check lists, in groups:

GroupWhat it lists
IncludedEvery resource in the export, and why: include, in system …, include x-public: true, referenced by …
ExcludedWhat exclude or neverExport took out of what the export would otherwise have
Links droppedLinks to resources outside the export, and why: not in this export, exclude
Links shown as namesWith references: name-only, the links shown as plain names
Not foundSelectors that matched nothing, and why
Links in docs that lead outside the export[[type|id]] links in docs, and the text shown in their place
HiddenThe fields left out

SDK​

getResourcesByProperty finds resources by custom property, as custom exports do:

import utils from '@eventcatalog/sdk';

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

await getResourcesByProperty('x-operational-tier', { equals: 1, types: ['service'], latestOnly: true });
OptionTypeDescription
equalsanyOnly resources whose value is this one.
inarrayOnly resources whose value is one of these.
typesstring[]Only these kinds of resource, such as service, event or domain.
latestOnlybooleanOnly the latest version of each resource.

Each result has the resource's type, id, version, the property's value, the path to its file and whether it's the latest version.

Exporters package​

To export from your own scripts, use the @eventcatalog/exporters package, which the build and the CLI use:

import { renderHtml, writeHtml, renderCustomExports, writeCustomExports, formatCustomExportReport } from '@eventcatalog/exporters';

// The architecture reference
const { html } = await renderHtml('/path/to/catalog');
await writeHtml({ dir: '/path/to/catalog', outputPath: 'architecture.html' });

// Custom exports: all of them, or those in `only`
const { rendered, failed } = await renderCustomExports('/path/to/catalog', { only: ['partner-payments'] });
console.log(formatCustomExportReport(rendered[0].report));
await writeCustomExports({ dir: '/path/to/catalog', outputDir: 'dist/exports' });
FunctionReturns
renderHtml(dir){ html, model }: the architecture reference
writeHtml({ dir, outputPath }){ html, model, path, bytes, durationMs }
renderCustomExports(dir, { only?, config? }){ rendered, failed }: rendered has { spec, html, model, report } for each custom export, and failed has { id, file, error } for each one that couldn't be exported
writeCustomExports({ dir, outputDir, only?, config? }){ written, failed }: the same, with each file's path and bytes
formatCustomExportReport(report)The --check output, as text
loadCatalog(dir)The catalog as one resolved model, to build your own export

config is exports.custom from eventcatalog.config.js, which is read from the catalog when you don't pass it.

Each custom export stands alone. One that can't be exported (its file has problems, two files share its id, it has nothing in it, or an id in only has no file) is in failed, with a CustomExportError that lists every problem in its problems, and the others are still exported. A problem with exports.custom itself throws.