# authbox.notifications.client

> Client for sending user notifications within AuthBox.io

Latest version **1.1.0** (published 2020-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install authbox.notifications.client
pnpm add authbox.notifications.client
yarn add authbox.notifications.client
bun add authbox.notifications.client
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-08-06 |
| First published | 2020-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 12.x.x |
| Dependencies | 1 |
| Unpacked size | 59.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | AuthBox.io |
| Maintainers | rhys_hampton_io |

## Links

- npm: https://www.npmjs.com/package/authbox.notifications.client
- Repository: https://github.com/hampton-io/AuthBox.NotificationsClient
- Homepage: https://github.com/hampton-io/AuthBox.NotificationsClient#readme
- Issues: https://github.com/hampton-io/AuthBox.NotificationsClient/issues
- npm.io page: https://npm.io/package/authbox.notifications.client

## Dependencies (1)

- [kue](https://npm.io/package/kue.md) ^0.11.6

## Recent versions

- 1.1.0 (latest) — 2020-08-06

## README

# AuthBox.notifications.client

[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)

Client for sending user notifications within AuthBox

## Usage

Create an instance of the NotificationClient, passing the connection string for the service

```
const NotificatonClient = require('authbox.notifications.client');
const client = new NotificatonClient({
  connectionString: '[CONNECTION-STRING-PROVIDED]'
});
```

The client then has methods for sending notifications. All methods return promises.

## Notifications

### Password reset

Send a notification when a password reset is requests

```
await client.sendPasswordReset(email, code, clientId);
```

- `email` the email address of the user receiving the notification
- `code` the reset code the assigned to the user of the reset
- `clientId` the clientId of the application where the user came from

### Invitation

Send an invitation to a user about a service

```
await client.sendInvitation(email, firstName, lastName, serviceName, serviceNameWelcomeMessage, 
        serviceNameWelcomeMessageDescription);
```

- `email` the email address of the user receiving the notification
- `firstName` first name of the recipient 
- `lastName` last name of the recipient
- `serviceName` name of the service they are invited to
- `serviceNameWelcomeMessage` paragraph of email introducing to service they are invited to
- `serviceNameWelcomeMessageDescription` paragraph of email giving a description of the service 

## Running locally

Install dependencies
```
npm i
```

Run relevant test script, for example:

```
node tools/sendPasswordReset.js
node tools/sendInvitation.js
```

By default, the test scripts are configured to use your local machine. If you want to use them against another connection, edit ./tools/config.json

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