# 555-ntm-sdk

> ## Overview

Latest version **1.1.4** (published 2024-08-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install 555-ntm-sdk
pnpm add 555-ntm-sdk
yarn add 555-ntm-sdk
bun add 555-ntm-sdk
```

## 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.4 |
| Published | 2024-08-22 |
| First published | 2020-05-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ayan_comcast, arunkavi, vikram_singh5 |

## Links

- npm: https://www.npmjs.com/package/555-ntm-sdk
- npm.io page: https://npm.io/package/555-ntm-sdk

## Dependencies (4)

- [utf8](https://npm.io/package/utf8.md) ^3.0.0
- [axios](https://npm.io/package/axios.md) ^1.6.3
- [events](https://npm.io/package/events.md) ^3.1.0
- [@react-native-community/async-storage](https://npm.io/package/@react-native-community/async-storage.md) ^1.10.1

## Recent versions

- 1.1.4 (latest) — 2024-08-22
- 1.1.3 — 2020-08-04
- 1.1.2 — 2020-08-04
- 1.1.1 — 2020-06-30
- 1.1.0 — 2020-05-28
- 1.0.0 — 2020-05-26

## README

# 555 NTM SDK

## Overview

555 Ntm SDK provides apis for subscribing for notification, deregister subscriber and deleting subscribed notification.

## Feature list
### SDK provides apis for

1) Register subscriber for a particular notification topic and protocol
2) Deregister subscriber
3) Delete subscribed notification
4) Setting the log level for sdk


## Usage
 
 The client can make use of this module for overall notification related task.

###### setConfig API

Use setConfig API to setup initial notification configuration.

```javascript
import Rtc555NTM from '555-ntm-sdk';
Rtc555NTM.setConfig(config);
````
#### Parameters

Below is the config object members need to be populated:


| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| token             | string | iris token            |
| routingId         | string | participant routing id|
| ntmUrl            | string | notification manager url|

###### createSubscriptions API

Use createSubscriptions API to create subscriptions for a specific topic and protocol for subscriber.

```javascript
import Rtc555NTM from '555-ntm-sdk';
Rtc555NTM.createSubscriptions(subscriptions,appDomain);
````
#### Parameters
| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| subscriptions     | array  | Array of subscription object|
| appDomain         | string | application domain          |


Below is the subscription object need to be populated:

| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| token             | string | device token          |
| protocol          | string | value like "xmpp or "fcm" or "apns" or "webn"|
| topic             | string | value like "pstn or "video"                  |

###### Handling Response
createSubscriptions API return a promise. <br/>
If call is successful.Response will have an array of objects which contains subscriberId,protocol and array of topics,for each unique subscriberID created.<br/>
Otherwise error JSON with code and reason for error.<br/>

```javascript
Rtc555NTM.createSubscriptions(subscriptions,appDomain)
    .then(function (response) {
    // handle success
  })
  .catch(function (error) {
    // handle error
    console.log(error.code);
    console.log(error.reason);
  })
   ````

###### deleteSubscription API

Use deleteSubscription API to delete a specific subscriber subscription.

```javascript
import Rtc555NTM from '555-ntm-sdk';
Rtc555NTM.deleteSubscription(subscriberId, topic,appDomain);
````
#### Parameters
| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| subscriberId      | string | subscriber id         |
| topic             | string | value like "pstn or "video"|
| appDomain         | string | application domain         |


###### Handling Response
deleteSubscription API return a promise. <br/>
If call is successful,object having topic and subscriberId of deleted subscription will be returned as response<br/>
Otherwise error JSON with code and reason for error.<br/>

```javascript
Rtc555NTM.deleteSubscription(subscriberId, topic,appDomain)
    .then(function (response) {
    // handle success
    console.log(response.topic);
    console.log(response.subscriberId);
  })
  .catch(function (error) {
    // handle error
    console.log(error.code);
    console.log(error.reason);
  })
   ````

###### deleteAllSubscriptions API

Use deleteAllSubscriptions API to deregister a subscriber.

```javascript
import Rtc555NTM from '555-ntm-sdk';
Rtc555NTM.deleteAllSubscriptions(subscriberId);
````
#### Parameters
| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| subscriberId      | string | subscriber id         |

###### Handling Response
deleteAllSubscriptions API return a promise. <br/>
If call is successful,deleted subscriberId will be returned as response<br/>
Otherwise error JSON with code and reason for error.<br/>

```javascript
Rtc555NTM.deleteAllSubscriptions(subscriberId)
    .then(function (subscriberId) {
    // handle success
    console.log(subscriberId);
  })
  .catch(function (error) {
    // handle error
    console.log(error.code);
    console.log(error.reason);
  });
   ````

###### setLogLevel API

Use setLogLevel API to set the log level for SDK.

```javascript
import Rtc555NTM from '555-ntm-sdk';
Rtc555NTM.setLogLevel(logLevel)
 ````
#### Parameters
| Property          | Type   | Description           |
|-------------------|--------|-----------------------|
| logLevel          | integer| Value can be any one of Rtc555NTM.LogLevel values|


Below are the Rtc555NTM.LogLevel values

Rtc555NTM.LogLevel.NO_LOG<br />
Rtc555NTM.LogLevel.ERROR<br />
Rtc555NTM.LogLevel.WARNING<br />
Rtc555NTM.LogLevel.INFO<br />
Rtc555NTM.LogLevel.DEBUG<br />
Rtc555NTM.LogLevel.VERBOSE

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