# CKBoxConfig

interface

The configuration of the [CKBox feature](module_ckbox_ckbox-CKBox.md).

The minimal configuration for the CKBox feature requires providing the [`config.ckbox.tokenUrl`](#member-tokenUrl):

```typescript
ClassicEditor
	.create( {
		ckbox: {
			tokenUrl: 'https://example.com/cs-token-endpoint'
		}
	} )
	.then( ... )
	.catch( ... );
```

Hovewer, you can also adjust the feature to fit your needs:

```typescript
ClassicEditor
	.create( {
		ckbox: {
			defaultUploadCategories: {
				Bitmaps: [ 'bmp' ],
				Pictures: [ 'jpg', 'jpeg' ],
				Scans: [ 'png', 'tiff' ]
			},
			ignoreDataId: true,
			serviceOrigin: 'https://example.com/',
			tokenUrl: 'https://example.com/cs-token-endpoint'
		}
	} )
	.then( ... )
	.catch( ... );
```

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

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L52)

<a id="properties">

## Properties

<a id="member-allowExternalImagesEditing">

### `allowExternalImagesEditing?: ArrayOrItem<RegExp | 'origin' | ( src: string ) => boolean>`

Allows editing images that are not hosted in CKBox service.

This configuration option should whitelist URL(s) of images that should be editable. Make sure that allowed image resources have CORS enabled.

The image is editable if this option is:

* a regular expression and it matches the image URL, or
* a custom function that returns `true` for the image URL, or
* `'origin'` literal and the image URL is from the same origin, or
* an array of the above and the image URL matches one of the array elements.

Images hosted in CKBox are always editable.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L118)

Defaults to `[]`

<a id="member-categories">

### `categories?: CKBoxCategoriesConfig`

Allows setting custom icons for categories.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L150)

<a id="member-choosableFileExtensions">

### `choosableFileExtensions?: Array<string>`

Specifies the file extensions considered valid for user interaction. Whith this option developers can restrict user interaction to only those assets whose file extensions match those listed in the array. Assets whose file extensions are not listed in the `choosableFileExtensions` array are automatically disabled within the CKBox interface.

```typescript
const ckboxConfig = {
		choosableFileExtensions: ['jpg', 'png']
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L175)

<a id="member-defaultUploadCategories">

### `defaultUploadCategories?: Record<string, Array<string>> | null`

Defines the categories to which the uploaded images will be assigned. If configured, it overrides the category mappings defined on the cloud service. The value of this option should be an object, where the keys define categories and their values are the types of images that will be uploaded to these categories. The categories might be referenced by their name or ID.

Example:

```typescript
const ckboxConfig = {
	defaultUploadCategories: {
		Bitmaps: [ 'bmp' ],
		Pictures: [ 'jpg', 'jpeg' ],
		Scans: [ 'png', 'tiff' ],
		// The category below is referenced by its ID.
		'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ]
	}
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L88)

Defaults to `null`

<a id="member-defaultUploadWorkspaceId">

### `defaultUploadWorkspaceId?: string`

Defines the workspace id to use during upload when the user has access to more than one workspace.

If defined, it is an error, when the user has no access to the specified workspace.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L95)

<a id="member-dialog">

### `dialog?: CKBoxDialogConfig`

This option allows opening CKBox in dialog mode. It takes a configuration object with the width and height attributes.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L145)

<a id="member-downloadableFiles">

### `downloadableFiles?: ( asset: CKBoxRawAssetDefinition ) => boolean`

Controls when to enable the download attribute for inserted links.

By default, files are downloadable.

```typescript
const ckboxConfig = {
  downloadableFiles: asset => asset.data.extension !== 'pdf'
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L188)

<a id="member-forceDemoLabel">

### `forceDemoLabel?: boolean`

Enforces displaying the "Powered by CKBox" link regardless of the CKBox plan used.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L100)

<a id="member-ignoreDataId">

### `ignoreDataId?: boolean`

Inserts the unique asset ID as the `data-ckbox-resource-id` attribute. To disable this behavior, set it to `true`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L125)

Defaults to `false`

<a id="member-language">

### `language?: string`

Configures the language for the CKBox dialog.

Defaults to [`Locale#uiLanguage`](module_utils_locale-Locale.md#member-uiLanguage)

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L139)

<a id="member-serviceOrigin">

### `serviceOrigin?: string`

Configures the base URL of the API service. Required only in on-premises installations.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L132)

Defaults to `'https://api.ckbox.io'`

<a id="member-theme">

### `theme?: string`

The theme for CKBox dialog.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L64)

<a id="member-tokenUrl">

### `tokenUrl?: TokenUrl`

The authentication token URL for CKBox feature.

Defaults to [`config.cloudServices.tokenUrl`](module_cloud-services_cloudservicesconfig-CloudServicesConfig.md#member-tokenUrl)

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L59)

<a id="member-upload">

### `upload?: CKBoxUploadConfig`

Configures when dialog should be minimized and hidden.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L160)

<a id="member-view">

### `view?: CKBoxViewConfig`

Configures the view of CKBox.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/src/ckboxconfig.ts#L155)

---

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