# Plugin

`class` in `seedcord` · v0.15.0

<https://docs.seedcord.org/packages/seedcord/0.15.0/classes/plugin>

Base class for Seedcord plugins

Extend this class to create plugins that integrate with the Seedcord lifecycle. Plugins have access to the core instance and must implement initialization logic.

```ts
abstract class Plugin<
    TPluginEvents extends SEEventMapLike<TPluginEvents> = SENoEvents
>
    extends StrictEventEmitter<TPluginEvents>
    implements Initializeable, HmrAware
```

## Constructors

### constructor

```ts
Plugin(pluggable: Core)
```

Constructs a new instance of the `Plugin` class

## Properties

### logger

```ts
public abstract logger: Logger
```

Logger instance for this plugin - must be implemented by subclasses

### name

```ts
public name: string
```

### pluggable

```ts
protected pluggable: Core
```

## Methods

### init

```ts
public abstract async init(): Promise<void>
```

Initialize the plugin - implement setup logic here Override this method in your plugin classes

### onHmr

```ts
public async onHmr(_event: HmrUpdateEvent): Promise<void>
```

Reloads plugin state on an HMR update.

### registerCriticalFiles

```ts
protected registerCriticalFiles(
    patterns: string[]
): void
```

Registers critical file patterns that should trigger a full restart when changed in Dev HMR.
