# ActionsRecorderConfig

interface

The configuration of the ActionsRecorder plugin.

```typescript
ClassicEditor
		.create( {
			actionsRecorder: ... // ActionsRecorder feature options.
		} )
		.then( ... )
		.catch( ... );
```

See [all editor configuration options](module_core_editor_editorconfig-EditorConfig.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/actionsrecorderconfig.ts#L26)

<a id="properties">

## Properties

<a id="member-maxEntries">

### `maxEntries?: number`

The maximum number of action entries to keep in memory. When this limit is reached, older entries will be removed.

This behavior can be modified by providing [`onMaxEntries`](#member-onMaxEntries) callback.

```typescript
ClassicEditor
		.create( {
			plugins: [ ActionsRecorder, ... ],
			actionsRecorder: {
				maxEntries: 1000
			}
		} )
		.then( ... )
		.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/actionsrecorderconfig.ts#L48)

Defaults to `1000`

<a id="member-onError">

### `onError?: ActionsRecorderErrorCallback`

Callback function called on caught error.

```typescript
ClassicEditor
		.create( {
			plugins: [ ActionsRecorder, ... ],
			actionsRecorder: {
				onError( error, entries ) {
					console.error( 'ActionsRecorder - Error detected:', error );
					console.warn( 'Actions recorded before error:', entries );

					this.flushEntries();
				}
			}
		} )
		.then( ... )
		.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/actionsrecorderconfig.ts#L94)

<a id="member-onFilter">

### `onFilter?: ActionsRecorderFilterCallback`

Filter function that determines whether a record should be added to the list. This is called before the action executes and before the entry is stored. It allows to reduce memory usage by filtering out unnecessary records.

If this function returns `false`, the record will not be stored in the entries array.

```typescript
ClassicEditor
		.create( {
			plugins: [ ActionsRecorder, ... ],
			actionsRecorder: {
				onFilter( entry, prevEntries ) {
					// Only record command executions.
					return entry.action.startsWith( 'commands.' );
				}
			}
		} )
		.then( ... )
		.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/actionsrecorderconfig.ts#L72)

<a id="member-onMaxEntries">

### `onMaxEntries?: ActionsRecorderMaxEntriesCallback`

Callback function called when recorded entries count reaches [`maxEntries`](#member-maxEntries).

```typescript
ClassicEditor
		.create( {
			plugins: [ ActionsRecorder, ... ],
			actionsRecorder: {
				onMaxEntries() {
					const entries = this.getEntries();

					this.flushEntries();

					console.log( 'ActionsRecorder - Batch of entries:', entries );
				}
			}
		} )
		.then( ... )
		.catch( ... );
```

By default, when this callback is not provided, the list of entries is shifted so it does not include more than [`maxEntries`](#member-maxEntries).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/actionsrecorderconfig.ts#L120)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
