@openfin/web-notifications-client 2.9.1-alpha-3944

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ <!-- README for NPM; the one for GitHub is in .github directory. -->
2
+
3
+ # Here™ Web Notification Center
4
+
5
+ ## Overview
6
+
7
+ The **Here™ Web Notification Center** offers a consistent and streamlined way for developers to create, display, and manage desktop notifications. It also supports handling notification events seamlessly within a web browser.
8
+
9
+ All notifications are displayed, categorized, and managed within a centralized Notification Center UI.
10
+
11
+ ### Features
12
+
13
+ - Create notifications.
14
+ - Clear and dismiss notifications.
15
+ - Attach handlers for when notifications are created, closed, and interacted with.
16
+ - Attach indicators and buttons with actions to notifications.
17
+ - Persist notifications in the Notification Center.
18
+ - Persist notification toasts.
19
+ - Create expiring and/or future notifications.
20
+ - Search notifications in the Notification Center.
21
+ - Create notifications with markdown, form, premade or custom templated notification content.
22
+ - Create grouping streams for notifications.
23
+ - Create pop-out frame windows for individiual notification senders and streams.
24
+ - Customize to specify the Notification Center and notification toast corners on screen.
25
+ - Customize Notification Center theme via Workspace Platforms.
26
+
27
+ ## Getting Started
28
+
29
+ To connect your application to the Web Notification Center, install the Here™ Web Notification Center Client API package.
30
+
31
+ ### Import the Web Notification Center Client API
32
+
33
+ ```bash
34
+ npm install @openfin/web-notifications-client
35
+ ```
36
+
37
+ ### Set Up the Core-Web Fin Context
38
+
39
+ Before using the Notification Center, ensure your application is configured with a `fin` context from the `@openfin/core-web` package.
40
+ This context provides the necessary runtime connection and environment information.
41
+
42
+ For setup instructions, refer to the [@openfin/core-web](https://www.npmjs.com/package/@openfin/core-web) documentation.
43
+
44
+ ### Usage
45
+
46
+ Connect to the Notification Center by importing the module and providing the required options, including the `finContext`, `serviceId`, and the container element.
47
+ The `serviceId` must match the one used by the Notification Center service to ensure successful communication.
48
+ The `id`, `title`, and `icon` define the identity of the client application within the Notification Center.
49
+ The `id` should remain consistent across sessions to ensure notifications are correctly associated with the same client.
50
+
51
+ ```ts
52
+ import { connectToNotifications, create } from '@openfin/web-notifications-client';
53
+
54
+ // initialize fin context.
55
+
56
+ // connect to the notification center.
57
+ await connectToNotifications({
58
+ finContext: fin,
59
+ serviceId: 'notification-center-service-channel',
60
+ id: 'notification-provider-app-unique-id',
61
+ title: 'My Notification Provider App',
62
+ icon: 'https://example.com/logo.png'
63
+ });
64
+
65
+ await create(notificationOptions);
66
+ ```