NuGet ยท nuget

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications

Provides a generic notification bus for Eltheon hosts and plugins.

Install

Install-Kommandos

dotnet add package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications --version 0.9.0.1
<PackageReference Include="Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications" Version="0.9.0.1" />
paket add Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications --version 0.9.0.1
Install-Package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications -Version 0.9.0.1

README

Vorschau

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications

Overview

This feature packages a lightweight notification bus that allows Eltheon hosts, templates, and plugins to publish operational events without coupling to specific UI implementations. Notifications can be routed to any number of sinks; the default sink provided by the package forwards messages to the existing Admin/User/Public SignalR hubs so web clients receive them instantly.

Building Blocks

  • NotificationMessage, NotificationScope, and NotificationSeverity define the shared payload contract.
  • INotificationPublisher offers a DI friendly abstraction for emitting messages.
  • NotificationBus fan-outs each published message to every registered INotificationSink.
  • NotificationSignalRDispatcher implements a sink that pushes notifications into the Admin/User/Public hubs via ReceiveNotification.
  • AddEltheonNotifications() registers the bus, while AddNotificationSignalRBridge() wires up the SignalR sink.

Usage

builder.Services
    .AddEltheonNotifications()
    .AddNotificationSignalRBridge();

public class ExampleService
{
    private readonly INotificationPublisher _publisher;

    public ExampleService(INotificationPublisher publisher) => _publisher = publisher;

    public Task NotifyAsync() =>
        _publisher.PublishAsync(NotificationMessage.Create(
            title: "Deployment",
            message: "A new build is live.",
            scope: NotificationScope.Admin | NotificationScope.User,
            severity: NotificationSeverity.Success));
}

On the client side, listen to the ReceiveNotification SignalR event (or the eltheon:notification DOM event used by the template) and render toast/snackbar components as needed.

Notes

  • The bus is synchronous per sink but awaits asynchronous work inside each sink.
  • Register your own sinks (e.g., persistence, queueing, external webhooks) by implementing INotificationSink.
  • The SignalR sink depends on the SignalR feature package being added to the host. The extension does not register hubs automatically.