EmailChannel dispatches notifications through the resolved IMailer.
-
isHealthy(): Promise<boolean | undefined>
Reports the mail transport's reachability by asking the injected
IMailer, which is the only channel in this package whose transport offers a side-effect-free probe. -
name: string
Channel dispatch name (e.g.
'email','sms'). -
send(notification: NotificationMessage): Promise<void>
Builds a
MailMessageand sends it viaIMailer.
FcmProvider implements PushTransport via the FCM HTTP v1 API.
-
send(message: PushMessage): Promise<void>
Sends a push notification via the FCM HTTP v1 endpoint.
NotificationService implements INotifier, fanning out a single
NotificationMessage across all requested channels in parallel via
Promise.allSettled. If any channel fails, it throws an AggregateError
whose members each name their channel (X8-12).
-
send(notification: NotificationMessage): Promise<void>
Dispatches a notification on every requested channel.
-
sendSettled(notification: NotificationMessage): Promise<readonly ChannelSendResult[]>
Dispatches a notification on every requested channel and reports the settled outcome of each, without throwing.
PushChannel dispatches notifications through a PushTransport (e.g. FcmProvider).
-
name: string
Channel dispatch name (e.g.
'email','sms'). -
send(notification: NotificationMessage): Promise<void>
Extracts
to.tokenand optionallysubjectas title, then sends viaPushTransport.
SlackChannel dispatches notifications through a SlackTransport (e.g. SlackProvider).
-
name: string
Channel dispatch name (e.g.
'email','sms'). -
send(notification: NotificationMessage): Promise<void>
Sends the body as text, optionally including
to.channel.
SlackProvider implements SlackTransport via a Slack incoming webhook URL.
-
send(message: SlackMessage): Promise<void>
Posts a message to the Slack webhook.
SmsChannel dispatches notifications through an SmsTransport (e.g. TwilioProvider).
-
name: string
Channel dispatch name (e.g.
'email','sms'). -
send(notification: NotificationMessage): Promise<void>
Extracts
to.phoneand sends viaSmsTransport.
TwilioProvider implements SmsTransport via the Twilio Accounts SID / Messages endpoint.
-
send(message: SmsMessage): Promise<void>
Sends an SMS via the Twilio REST API.
Creates a NotificationChannel for the given channel entry.
Creates the default fetch-backed INotificationHttp.
Creates the transport for a channel configuration.
Creates the plugin factory.
Push channel configuration — options are FcmProviderOptions.
Options for FcmProvider.
-
clientEmail: string
Service-account email that signs the OAuth2 assertion. Required unless
tokenSourceis supplied. - http: INotificationHttp
-
privateKey: string
PEM PKCS#8 private key for the service account. Required unless
tokenSourceis supplied. -
projectId: string
Firebase project id; addressed by the v1
messages:sendURL. -
runtime: IRuntimeServices
Runtime services providing Web Crypto and the wall clock, used to sign the assertion and expire cached tokens. Required unless
tokenSourceis supplied; the plugin passes this automatically. -
tokenSource: FcmTokenSource
Overrides how access tokens are acquired — e.g. from a GCP metadata server instead of a locally held key. When set, the three credential fields above are unused.
Supplies OAuth2 access tokens for FCM HTTP v1.
-
getAccessToken(): Promise<string>
Returns a valid access token, minting or refreshing one as needed.
Injectable HTTP seam for notification providers.
-
post(): Promise<NotificationHttpResponse>url: string,body: string,headers: Record<string, string>
Issues a POST request and returns a mapped response.
Multi-channel notification dispatcher.
-
send(notification: NotificationMessage): Promise<void>
Dispatches a notification on every requested channel.
-
sendSettled(notification: NotificationMessage): Promise<readonly ChannelSendResult[]>
Dispatches a notification on every requested channel and reports the settled outcome of each, without throwing.
Response shape returned by INotificationHttp.post.
A notification dispatched across one or more channels.
-
body: string
Notification body.
-
channels: readonly string[]
Channel names to dispatch on (e.g.
['email', 'sms']). -
metadata: Readonly<Record<string, unknown>>
Channel-specific extras.
-
subject: string
Subject/title, for channels that support one.
-
to: Readonly<Record<string, string>>
Recipient addresses keyed by channel (e.g.
{ email: '…', phone: '…' }).
Options for NotificationPlugin.
-
channels: ChannelsMap
Channel definitions keyed by dispatch name.
An outgoing push-notification message shaped by PushTransport.
Push-notification transport port implemented by FcmProvider.
-
send(message: PushMessage): Promise<void>
Sends a push notification.
Slack channel configuration — options are SlackProviderOptions.
Slack transport port implemented by SlackProvider.
-
send(message: SlackMessage): Promise<void>
Posts a Slack message.
SMS transport port implemented by TwilioProvider.
-
send(message: SmsMessage): Promise<void>
Sends an SMS message.
SMS channel configuration — options are TwilioProviderOptions.
| TwilioChannelConfig
| FcmChannelConfig
| SlackChannelConfig
Per-channel configuration, discriminated on provider.
Plugin-level channels map.
Union of every transport a channel can be built on, as returned by
createProvider.
Provider type selector — the ChannelConfig discriminant.
Usage
import * as Multi_channel_notification_plugin__email__SMS__push__Slack___Provides__NotificationPlugin___factory____NotificationService___the__INotifier__implementation___channel_factories___createChannel____provider_factories___createProvider____four_channel_classes___EmailChannel____SmsChannel____PushChannel____SlackChannel____three_HTTP_providers___TwilioProvider____FcmProvider____SlackProvider____the_shared__INotificationHttp__seam_plus_its_fetch_backed_default___createDefaultNotificationHttp____and_all_option_type_shapes___The_plugin_registers_an__INotifier__under__CAPABILITIES_NOTIFICATION___ from "notification-plugin/src/index.ts";