---
url: /api/kiln/functions/plugin.md
---
[Kiln API](../../index.md) / [kiln](../index.md) / plugin

# Function: plugin()

```ts
function plugin(build, name?): Plugin;
```

Defines a plugin. It may be async (e.g. to init WASM); `app.ready()` waits for it and
`scenario()` does so for you.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `build` | (`app`) => `void` | `Promise`<`void`> |
| `name?` | `string` |

## Returns

[`Plugin`](../interfaces/Plugin.md)
