# send-push-notification

> A lightweight and easy-to-use Node.js package for sending notifications via the Pushover service

Latest version **2.2.0** (published 2024-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install send-push-notification
pnpm add send-push-notification
yarn add send-push-notification
bun add send-push-notification
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2024-03-31 |
| First published | 2023-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ashik Nesin |
| Maintainers | ashiknesin |

## Links

- npm: https://www.npmjs.com/package/send-push-notification
- Repository: https://github.com/AshikNesin/send-push-notification
- Homepage: https://github.com/AshikNesin/send-push-notification#readme
- Issues: https://github.com/AshikNesin/send-push-notification/issues
- npm.io page: https://npm.io/package/send-push-notification

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.6.8

## Recent versions

- 2.2.0 (latest) — 2024-03-31
- 2.1.0 — 2023-04-07
- 2.0.0 — 2023-04-06

## README

# Send Push Notification Package

This package provides a simple way to send notifications using the [Pushover](https://pushover.net/) service. It exports a single function, `sendPushOverNotification`, which you can use to send a notification with a given payload.

## Installation

To install the package, use your favorite package manager:

```bash
npm install --save send-push-notification
```

or

```bash
yarn add send-push-notification
```

## Usage

First, you need to set your Pushover user key and API token as environment variables:

```bash
export PUSHOVER_USER_KEY=your_user_key
export PUSHOVER_API_TOKEN=your_api_token
```

Then, you can use the `sendPushOverNotification` function to send a notification:

```javascript
import { sendPushOverNotification } from 'send-push-notification';

const payload = {
    message: 'Hello, World!',
    title: 'My First Notification',
    // Other optional parameters: https://pushover.net/api#messages
};

sendPushOverNotification(payload)
    .then(response => {
        console.log('Notification sent successfully:', response);
    })
    .catch(error => {
        console.error('Failed to send notification:', error);
    });
```

## Error Handling

In case of an error, the function will throw an error with a descriptive message. You can handle the error using a try-catch block or with a `.catch()` method in a promise chain.

## API Reference

For more information about the Pushover API and the available parameters, please refer to the official [Pushover API documentation](https://pushover.net/api).

## License

This package is licensed under the MIT License.

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