@thefirstspine/messaging
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

📦 dependency-messaging // @thefirstspine/messaging

Javascript and Typescript service to interact with the messaging net service.

More information here: https://github.com/thefirstspine/messaging

Install

npm i @thefirstspine/messaging@latest

Configuration

As part of TFS Platform, this dependency will use environment variable.

Environement key Summary
MESSAGING_URL Messaging net service URL
MESSAGING_PUBLIC_KEY Public key to interact with the messaging net service

Documentation

MessagingService

Main service to interact with the messaging net service.

sendMessage

Sends a message in a subject to the clients connected to the service.

Synopsis: async sendMessage(to: number[]|'*', subject: string|'*', message: any): Promise<IMessagingResponse>

Params:

  • to: number[]|'*' The list of the users that will receive the message. * is for all users.
  • subject: string|'*' The subject concerned by the message.
  • message: any The message to send.

getMessagingNetServiceUrl

Get the messaging net service URL according to the MESSAGING_URL environment variable.

Synopsis: getMessagingNetServiceUrl(): string

How to use

Build

npm run build

Lint

npm run lint

Publish on NPM

npm publish

License

TFS Platform is NOT licensed. You are free to download, view, run the repository. You are NOT allowed to redistribute this project for both commercial and non-commercial use. Deal with it.

Readme

Keywords

none

Package Sidebar

Install

npm i @thefirstspine/messaging

Weekly Downloads

4

Version

2.0.2

License

ISC

Unpacked Size

24.9 kB

Total Files

11

Last publish

Collaborators

  • thefirstspine