# sns-node-client

> A Node.JS client for the Simple Notification Service

Latest version **1.1.0** (published 2017-02-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install sns-node-client
pnpm add sns-node-client
yarn add sns-node-client
bun add sns-node-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 | 2017-02-10 |
| First published | 2017-02-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Collins |
| Maintainers | mattcollins84 |

## Links

- npm: https://www.npmjs.com/package/sns-node-client
- Repository: https://github.com/ibm-cds-labs/sns-node-client
- Homepage: https://github.com/ibm-cds-labs/sns-node-client#readme
- Issues: https://github.com/ibm-cds-labs/sns-node-client/issues
- npm.io page: https://npm.io/package/sns-node-client

## Dependencies (1)

- [socket.io-client](https://npm.io/package/socket.io-client.md) ^1.7.2

## Recent versions

- 1.1.0 (latest) — 2017-02-10
- 1.0.0 — 2017-02-06

## README

# sns-node-client
A Node.JS client for the [Simple Notification Service](https://github.com/ibm-cds-labs/simple-notification-service).

Please refer to the Simple Notification Service readme file for the following:

* [Sending Notifications](https://github.com/ibm-cds-labs/simple-notification-service#snssend-userquery-notificationdata-)
* [Handling Events](https://github.com/ibm-cds-labs/simple-notification-service#events)

## Connecting and Authentication
There is a slight difference between the Node.JS client library and the Browser based client library, and that is how you connect and authenticate with the Simple Notification Service.

As well as providing an API key, some `userData` and a `userQuery`, you will also need to provide a hostname. This hostname will be tied to the API key that you have supplied in exactly the same way as [via the browser](https://github.com/ibm-cds-labs/simple-notification-service#authentication).

The way of providing this data is also slightly different:

````js
const SNSClient = require('sns-node-client')({
  sns_host: '<YOUR_SNS_HOSTNAME>',
  authentication: {
    host: "<YOUR_AUTH_HOST>",
    key: "<YOUR_API_KEY>"
  },
  userData: {
    name: "Matt",
    age: 32,
    country: "USA",
    user_type: "chat"
  },
  userQuery: {
    country: "USA",
    user_type: "chat"
  }
});
````

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