function NotificationPlugin
Since 0.1.0
NotificationPlugin(options: NotificationPluginOptions): IPlugin

Creates the plugin factory.

Registers an INotifier under CAPABILITIES.NOTIFICATION backed by the configured channels and providers.

Examples

Example 1

import { NotificationPlugin } from '@setu-ts/notification-plugin';

app.register(NotificationPlugin({
  channels: {
    email: { provider: 'mail' },
    sms: {
      provider: 'twilio',
      options: { accountSid: '…', authToken: '…', from: '+1234' },
    },
    slack: { provider: 'slack', options: { webhookUrl: 'https://hooks.slack.com/…' } },
  },
}));

Parameters

Plugin configuration

Return Type

IPlugin

The plugin instance

Usage

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