# Interface: Plugin

Defined in: [core/src/plugin.ts:20](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/core/src/plugin.ts#L20)

A runtime plugin extends a `Game` through its public API (hooks, params, inspect, scenes).

```ts
export function debugGrid(options: { size?: number } = {}): Plugin {
  return {
    name: "debug-grid",
    install(game) {
      const params = game.params.define("debug-grid", { size: { type: "number", default: options.size ?? 16, min: 4, max: 128 } });
      return game.hooks.afterRender((ctx) => drawGrid(ctx, params.values.size));
    },
  };
}

game.use(debugGrid());
```

## Properties

### name

> `readonly` **name**: `string`

Defined in: [core/src/plugin.ts:22](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/core/src/plugin.ts#L22)

Unique kebab-case id. Also the conventional namespace for the plugin's params and inspect data.

## Methods

### install()

> **install**(`game`): (() => `void`) \| `undefined`

Defined in: [core/src/plugin.ts:24](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/core/src/plugin.ts#L24)

Called once by `game.use()`. Return a cleanup function to run on `game.dispose()`.

#### Parameters

##### game

[`Game`](../classes/Game.md)

#### Returns

(() => `void`) \| `undefined`
