# @opensrp/notifications

> Utility functions for dispaying OpenSRP web notifications

Latest version **0.0.5** (published 2021-03-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @opensrp/notifications
pnpm add @opensrp/notifications
yarn add @opensrp/notifications
bun add @opensrp/notifications
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2021-03-04 |
| First published | 2020-11-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | OpenSRP Engineering |
| Maintainers | opensrp-admin |

## Links

- npm: https://www.npmjs.com/package/@opensrp/notifications
- Repository: https://github.com/opensrp/web
- Homepage: https://github.com/opensrp/web#readme
- Issues: https://github.com/opensrp/web/issues
- npm.io page: https://npm.io/package/@opensrp/notifications

## Recent versions

- 0.0.5 (latest) — 2021-03-04
- 0.0.4 — 2021-02-24
- 0.0.3 — 2021-02-18
- 0.0.2 — 2020-11-12
- 0.0.1 — 2020-11-05

## README

# Notifications

The package contains utility functions for displaying notifications

## Installation

```sh
yarn add @opensrp/notifications
```

## Usage

The following available functions support different types of notifications:

`sendSuccessNotification`: Used to display a success popup

`sendInfoNotification`: Used to display an information popup

`sendWarningNotification`: Used to display a warning popup

`sendErrorNotification`: Used to display an error popup

Each of these methods accepts the following arguments:

1. `message`: **string**

This is the notification title and is required

2. `description`: **string**

This is the content of the notification. It's optional. A blank body will be displayed if it's not
provided.

### Code examples

```ts
/**
 * antd notification popup.
 *
 * @param {user} user details object
 */
export const openNotification = (user: User): void => {
  sendSuccessNotification(`Welcome back, ${user.username}`, 'You have 8 new messages');
};
```

---
_Source: https://npm.io/package/@opensrp/notifications · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
