@opuscapita/notification-client
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Notification-Client Library

Overview

The Notification-Client library is a React-based solution designed to deliver real-time notifications to users in a web application. It integrates with a WebSocket backend(live-notification) to provide instant updates and filters notifications dynamically based on user roles, associated business partners, and the currently active service within the application.

Key Features

  • Real-Time Updates: Utilizes WebSocket technology for immediate delivery of notifications.
  • Context-Aware Filtering:
    • Filters notifications based on user roles, ensuring relevance to specific permissions.
    • Matches notifications to the user's associated business partner.
    • Adapts notifications to the currently displayed service.
  • Integration: Serves as a wrapper around the main application.

Requirements

To function correctly, the library requires the following props to be passed:

  • userData.roles: An array of roles associated with the current user, which determines role-based filtering of notifications.
  • userData.businesspartner: The business partner associated with the user, used for context-specific filtering.
<LiveNotificationContainer
userDataRoles={userData.roles}
userDataBusinessPartner={userData.businesspartner}
>

These props allow the library to connect to the backend and filter notifications accurately based on the user context.

How It Works

  1. Backend Communication(live-notification): Connects to the WebSocket backend to receive live notifications.
  2. Dynamic Filtering: Filters notifications using user-specific data (roles, businessPartner, and the active service) to ensure only relevant notifications are displayed.
  3. Seamless Embedding: Acts as a container for a main application, wrapping its content and managing notifications without disrupting the user experience showing the notification at the top of the screen.

Readme

Keywords

none

Package Sidebar

Install

npm i @opuscapita/notification-client

Weekly Downloads

24

Version

1.1.1

License

none

Unpacked Size

14.9 kB

Total Files

18

Last publish

Collaborators

  • kuos
  • ocmachineuser
  • elaczapiewska
  • ocautomation
  • piotr.krzysztof.murdzia
  • dsbbl
  • smachnow
  • ariusz
  • ilhamkadduri