function createProvider
Since 0.1.0
createProvider(
ctx?: IPluginContext
): IMailer

Creates the transport for a channel configuration.

For 'mail', resolves IMailer from the context service registry. For 'twilio', 'fcm', and 'slack', constructs the corresponding HTTP provider from the config's options, which each provider validates.

The overloads bind each config arm to the transport port it produces, so a caller never has to narrow or cast the result.

Parameters

The channel configuration

optional
ctx: IPluginContext

The plugin context (for resolving IMailer when provider is 'mail')

Return Type

IMailer

The transport for this configuration

Throws

Error

If the provider type is unsupported, required options are missing, or mail is configured without MailPlugin

createProvider(config: TwilioChannelConfig): SmsTransport

Parameters

Return Type

createProvider(
ctx?: IPluginContext
): PushTransport

Parameters

optional
ctx: IPluginContext

Return Type

createProvider(config: SlackChannelConfig): SlackTransport

Parameters

Return Type

createProvider(
config: ChannelConfig,
ctx?: IPluginContext
): NotificationTransport

Parameters

optional
ctx: IPluginContext

Return Type