# PluginLifecycleSpec

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

<https://seedcord.org/docs/packages/core/0.10.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](/docs/packages/core/0.10.0/enums/startup-phase)
- [ShutdownPhase](/docs/packages/core/0.10.0/enums/shutdown-phase)
