Skip to content
mercury framework
GitHub

ChannelPlugin

ChannelPlugin = object

Defined in: types/channel-types/index.ts:468

A channel plugin: the value the core’s channel loader consumes, mirroring @mercury-fw/plugin-types’ Plugin. A channel package exports one and does not import the app.

  • apiVersion: contract version (see CHANNEL_API_VERSION); the loader refuses a mismatch.
  • name: the channel’s id, and the key the loader registers the provider under (the cron layer looks up "google-chat" for its Notifier).
  • build: builds the Provider from the context, or undefined when the instance isn’t configured for this channel (e.g. no GOOGLE_CHAT_PUBSUB_SUBSCRIPTION) → the loader treats it as “present but inert” and never starts it.
  • messages: the channel’s texts a person sees, in English, every key under <name>.; the loader refuses a channel with a key outside it (and one named core or app). The instance’s language files translate them, and the channel gets them through ctx.i18n.

apiVersion: number

Defined in: types/channel-types/index.ts:469


build: (ctx) => Provider | undefined

Defined in: types/channel-types/index.ts:471

ChannelRuntimeContext

Provider | undefined


optional messages?: Messages

Defined in: types/channel-types/index.ts:472


name: string

Defined in: types/channel-types/index.ts:470