Are you an LLM? You can read better optimized documentation at /documentation/api/core/functions/definePlugin.md for this page in Markdown format
ws-asyncapi API / core / definePlugin
Function: definePlugin()
definePlugin<
Setup>(options):NamedPlugin<Setup>
Defined in: .api-entries/core/index.d.ts:614
Tag a plugin with a stable name so Channel.use applies it at most once per channel. setup is the plugin body — (channel) => extended channel.
The same typing rules as .use apply: inline-shaped and hook-only setups keep full typing; reusable setups that add context/contract run at runtime but their added types don't thread through a by-reference application.
Type Parameters
Setup
Setup extends (channel) => unknown
Parameters
options
name
string
setup
Setup
Returns
NamedPlugin<Setup>