# PluginLifecycleSpec

`interface` in `core/plugin` · v0.7.0

<https://docs.seedcord.org/packages/core/0.7.0/interfaces/plugin-lifecycle-spec>

Sets when a plugin's lifecycle methods run. Pass it as the second argument to `super()`. Omit a field to keep its default.

```ts
interface PluginLifecycleSpec
```

## Examples

```ts
super(host, { init: { phase: StartupPhase.Login }, dispose: { timeout: 30_000 } });
```

## Properties

### dispose

```ts
dispose: { phase?: ShutdownPhase; timeout?: number; }
```

Defaults to `ShutdownPhase.Disconnect` and 10000ms.

### init

```ts
init: { phase?: StartupPhase; timeout?: number; }
```

Defaults to `StartupPhase.Configuration` and 15000ms. Set the phase to `Ready` and `init()` runs ahead of every plugin's `ready()`.

### ready

```ts
ready: { timeout?: number; }
```

`ready()` always runs in `StartupPhase.Ready`. Defaults to a 15000ms timeout.

## See also

- [StartupPhase](/packages/core/0.7.0/enums/startup-phase)
- [ShutdownPhase](/packages/core/0.7.0/enums/shutdown-phase)
