https://github.com/intersective/messaging-sdk
https://github.com/intersective/messaging-sdk
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/intersective/messaging-sdk
- Owner: intersective
- Created: 2021-02-26T00:21:20.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-05T21:34:44.000Z (over 3 years ago)
- Last Synced: 2025-10-05T20:47:13.715Z (8 months ago)
- Language: TypeScript
- Size: 699 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @practera/messaging-sdk
Facilitates the communication with the Practera messaging API.
## Health
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
[](https://sonarcloud.io/dashboard?id=intersective_messaging-sdk)
## Install
```
$ npm install @practera/messaging-sdk
```
## Usage
### setting up the client
JavaScript:
```js
const Messages = require("@practera/messaging-sdk");
```
TypeScript:
```js
import { Messages } from "@practera/messaging-sdk";
```
Sending a json to the messaging service
```js
const client = new Messages.create(
privateKey, // the private key used to sign the request
service, // this will identify what public key to use to validate the token, the variable called ${service}_JWT will be used. The variable should contain a key called public and the public key as the value.
url, // the URL of the messaging API, leave empty for production
);
// to perform the api call for the data
client.send({message: 'Hello world !!!'});
// a singleton has been created so after creating the initial client you can also call it using
Messages.instance.send({wow: "blah"});
```