Copy as Markdown[View as Markdown](/docs/sdk/functions/appendChangelog.md)

***

# Function: appendChangelog()

> **appendChangelog**(`catalogDir`): (`id`, `changelog`, `options`) => `Promise`<`void`>

Defined in: changelogs.ts:91

Appends a changelog entry to an existing changelog for a resource. If no changelog exists, one is created.

New entries are prepended to the top of the existing content, separated by `---`.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter    | Type     |
| ------------ | -------- |
| `catalogDir` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter          | Type                                                  |
| ------------------ | ----------------------------------------------------- |
| `id`               | `string`                                              |
| `changelog`        | `Changelog`                                           |
| `options`          | { `format`: `"md"` \| `"mdx"`; `version`: `string`; } |
| `options.format`?  | `"md"` \| `"mdx"`                                     |
| `options.version`? | `string`                                              |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

## Example[​](#example "Direct link to Example")

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

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

// Append to an existing changelog (or create if none exists)
await appendChangelog('OrderCreated', {
  createdAt: '2024-09-01',
  markdown: '### New field added\n\nAdded `priority` field.',
});

// Append to a specific version's changelog
await appendChangelog('OrderCreated', {
  createdAt: '2024-09-01',
  markdown: '### Bugfix\n\nFixed validation.',
}, { version: '1.0.0' });
```
