# PluginConstructor

typedef

Creates a new plugin instance. This is the first step of the plugin initialization. See also [`init`](module_core_plugin-PluginInterface.md#function-init) and [`afterInit`](module_core_plugin-PluginInterface.md#function-afterInit).

The plugin static properties should conform to [`PluginStaticMembers` interface](module_core_plugin-PluginStaticMembers.md).

A plugin is always instantiated after its [dependencies](module_core_plugin-PluginStaticMembers.md#member-requires) and the [`init`](module_core_plugin-PluginInterface.md#function-init) and [`afterInit`](module_core_plugin-PluginInterface.md#function-afterInit) methods are called in the same order.

Usually, you will want to put your plugin's initialization code in the [`init`](module_core_plugin-PluginInterface.md#function-init) method. The constructor can be understood as "before init" and used in special cases, just like [`afterInit`](module_core_plugin-PluginInterface.md#function-afterInit) serves the special "after init" scenarios (e.g.the code which depends on other plugins, but which does not [explicitly require](module_core_plugin-PluginStaticMembers.md#member-requires) them).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/plugin.ts#L249)

<a id="type-parameters">

## Type parameters

### `TContext: Editor`

#### Value

`PluginClassConstructor<TContext> | PluginFunctionConstructor<TContext> & PluginStaticMembers<TContext>`

---

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