@openfin/web-notifications-client
TypeScript icon, indicating that this package has built-in type declarations

2.10.0 • Public • Published

Here™ Web Notification Center

Overview

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.

All notifications are displayed, categorized, and managed within a centralized Notification Center UI.

Features

  • Create notifications.
  • Clear and dismiss notifications.
  • Attach handlers for when notifications are created, closed, and interacted with.
  • Attach indicators and buttons with actions to notifications.
  • Persist notifications in the Notification Center.
  • Persist notification toasts.
  • Create expiring and/or future notifications.
  • Search notifications in the Notification Center.
  • Create notifications with markdown, form, premade or custom templated notification content.
  • Create grouping streams for notifications.
  • Create pop-out frame windows for individiual notification senders and streams.
  • Customize to specify the Notification Center and notification toast corners on screen.
  • Customize Notification Center theme via Workspace Platforms.

Getting Started

To connect your application to the Web Notification Center, install the Here™ Web Notification Center Client API package.

Import the Web Notification Center Client API

npm install @openfin/web-notifications-client

Set Up the Core-Web Fin Context

Before using the Notification Center, ensure your application is configured with a fin context from the @openfin/core-web package. This context provides the necessary runtime connection and environment information.

For setup instructions, refer to the @openfin/core-web documentation.

Usage

Connect to the Notification Center by importing the module and providing the required options, including the finContext, serviceId, and the container element. The serviceId must match the one used by the Notification Center service to ensure successful communication. The id, title, and icon define the identity of the client application within the Notification Center. The id should remain consistent across sessions to ensure notifications are correctly associated with the same client.

import { connectToNotifications, create } from '@openfin/web-notifications-client';

// initialize fin context.
// connect to the notification center.
await connectToNotifications({
  finContext: fin,
  serviceId: 'notification-center-service-channel',
  id: 'notification-provider-app-unique-id',
  title: 'My Notification Provider App',
  icon: 'https://example.com/logo.png'
});

await create(notificationOptions);

Readme

Keywords

none

Package Sidebar

Install

npm i @openfin/web-notifications-client

Homepage

www.here.io/

Weekly Downloads

139

Version

2.10.0

License

SEE LICENSE IN LICENSE.MD

Unpacked Size

118 kB

Total Files

5

Last publish

Collaborators

  • openfincolinhu
  • openfinbrandon
  • pierrebaize
  • noyangunday
  • michaelmcoates
  • alan15008
  • imansuri
  • johnmandia-openfin
  • rdepena
  • tgoc99
  • wenjunche
  • harsimran.openfin.singh
  • michal-pichlinski-here
  • luiemilio
  • licui3936
  • connormccafferty
  • adam.saland
  • openfin-ci
  • chrishobsonexpero
  • richbrowne-openfin
  • azizyok
  • hzhi0209
  • openfin-gavin
  • oblarg
  • newaz.sharif
  • andy.westacott
  • shahossain
  • eugeneross-openfin
  • gouthamc
  • openfin-jeff
  • sakibahmad
  • manamiueda
  • xyopenfin
  • hannahmcmillen
  • smocarski
  • davidcoxon-of
  • dhilan
  • __tomasz__
  • galim.kaudinov
  • ife-dev1
  • gallak-openfin
  • vsaw3
  • eheyder
  • elliott.burr
  • mjosling
  • yoge-openfin
  • nil.ffej
  • hina-khalid
  • eoyewobi
  • gilesstevenson-openfin
  • yongji.chen
  • marek_openfin
  • jmransegnola
  • ameet-openfin
  • rutu-b
  • michalzz
  • openfin-johans
  • andrewche3
  • openfin-ci-gh
  • ahk
  • jeffersongarcia25
  • tpatek17
  • cezary_openfin
  • oliviatarsi