function createChannel
Since 0.1.0
createChannel(
name: string,
config: ChannelConfig,
ctx?: IPluginContext
): NotificationChannel

Creates a NotificationChannel for the given channel entry.

Resolves the transport via createProvider, then wraps it in the matching channel class (EmailChannel, SmsChannel, PushChannel, or SlackChannel).

Parameters

name: string

The channel dispatch name

The channel configuration

optional
ctx: IPluginContext

The plugin context (required for 'mail', which resolves IMailer)

Return Type

NotificationChannel

The configured channel

Throws

Error

If the provider type is unsupported or mail is used without MailPlugin

Usage

import { createChannel } from "notification-plugin/src/index.ts";