Setu-TS
    Preparing search index...

    Function createProvider

    NotificationPlugin factory — registers an INotifier under CAPABILITIES.NOTIFICATION.

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

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

    0.1.0

    • 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

      Returns IMailer

      The transport for this configuration

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

      0.1.0

    • 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

      Returns SmsTransport

      The transport for this configuration

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

      0.1.0

    • 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

      Returns PushTransport

      The transport for this configuration

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

      0.1.0

    • 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

      Returns SlackTransport

      The transport for this configuration

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

      0.1.0

    • 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

      • config: ChannelConfig

        The channel configuration

      • Optionalctx: IPluginContext

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

      Returns NotificationTransport

      The transport for this configuration

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

      0.1.0