npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flusys/ng-notification

v5.0.1

Published

Real-time notification module with Socket.IO for FLUSYS Angular applications

Readme

@flusys/ng-notification

Real-time notification UI for FLUSYS — Socket.IO WebSocket client, signal-based state, notification bell widget injected into the layout topbar.

npm version License: MIT


Installation

npm install @flusys/ng-notification socket.io-client

1. Register Providers

Call provideNotificationProviders() in app.config.ts. This registers the bell component into the layout topbar via LAYOUT_NOTIFICATION_BELL — no layout package dependency on ng-notification.

// app.config.ts
import { provideNotificationProviders } from '@flusys/ng-notification';

export const appConfig: ApplicationConfig = {
  providers: [
    ...provideNotificationProviders(),
  ],
};

2. Add Notification Route

// app.routes.ts
import { NOTIFICATION_ROUTES } from '@flusys/ng-notification';

export const routes: Routes = [
  {
    path: 'notifications',
    loadChildren: () => NOTIFICATION_ROUTES, // full notification list page, requires auth
  },
];

3. Connect the WebSocket After Login

NotificationSocketService.connect() requires the JWT access token. Call it after authentication is confirmed — typically from an auth bridge service.

import { NotificationStateService } from '@flusys/ng-notification';

@Injectable({ providedIn: 'root' })
export class AuthNotificationBridge {
  private readonly notifState = inject(NotificationStateService);

  onUserLoggedIn(accessToken: string): void {
    this.notifState.connectSocket(accessToken); // connects Socket.IO, loads unread count
  }

  onUserLoggedOut(): void {
    this.notifState.disconnectSocket();
  }
}

The socket connects to {apiBaseUrl}/notifications (or services.notification.socketUrl if set in APP_CONFIG).

4. Read Notification State

NotificationStateService is root-provided and exposes readonly signals.

import { NotificationStateService } from '@flusys/ng-notification';

@Component({ ... })
export class MyComponent {
  private readonly notifState = inject(NotificationStateService);

  readonly unreadCount = this.notifState.unreadCount;   // Signal<number>
  readonly notifications = this.notifState.notifications; // Signal<INotification[]>
  readonly isLoading = this.notifState.isLoading;       // Signal<boolean>
  readonly isConnected = this.notifState.isConnected;   // Signal<boolean>

  markRead(id: string): void {
    this.notifState.markAsRead(id);
  }

  markAll(): void {
    this.notifState.markAllAsRead();
  }

  loadPage(page: number): void {
    this.notifState.loadNotifications(page);
  }
}

Socket Events (Reference)

| Server event | Payload | Effect | |---|---|---| | notification:new | INotificationPayload | Prepended to list, unread count +1, PrimeNG toast shown | | notification:read | { id: string } | Marks item read, count -1 | | notification:read-all | — | All items marked read, count set to 0 |

Socket reconnects automatically up to 5 times (1 s delay, max 5 s) before stopping.

License

MIT © FLUSYS