# @growsari/event-gateway-client

> Client library for interacting with Growsari Event Gateway

Latest version **1.0.3** (published 2019-11-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @growsari/event-gateway-client
pnpm add @growsari/event-gateway-client
yarn add @growsari/event-gateway-client
bun add @growsari/event-gateway-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.0.3 |
| Published | 2019-11-12 |
| First published | 2019-10-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Prasad K |
| Maintainers | gs.dwight.badua, leland.growsari, melyo, prasad.riktam |
| Keywords | growsari event-gateway-client |

## Links

- npm: https://www.npmjs.com/package/@growsari/event-gateway-client
- Repository: git@git.growsari.com:core/packages/event-gateway-client
- npm.io page: https://npm.io/package/@growsari/event-gateway-client

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.88.0
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.7

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-11-12
- 1.0.2 — 2019-10-18
- 1.0.1 — 2019-10-18
- 1.0.0 — 2019-10-18

## README

# Event Gateway Client
Client library for interacting with Growsari Event Gateway

## Installation
Install the package using the below command: 
    
    $ npm i @growsari/event-gateway-client --save

## Usage

### Create EventGatway Client 
Create a client by passing in clientId (for now till the service implements authentication)

    let client = new EventGatewayClient('ms-loc');

### Subsribe to a topic
It accepts topic name and notification url (to get the notifications)

    client.subscribeToTopic(topicName, notificationUrl);

### Publish message to a topic
It accepts topic name and list of messages.
Each message contains event name and the payload.

    client.publishMessage(topicName, [ message,..}]);

## Examples:

    let client = new EventGatewayClient('ms-loc');

    // Subscribe to a Topic - orders
    client.subscribeToTopic('orders', 'http://127.0.0.1/ms-loc/test-event-push');

    // Publish Event Message to a Topic - orders
    client.publishMessage('orders', [{ event: 'ORDER_CREATED', payload: { "order_id": 10, "price": 10.0 } }]);

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