1.0.19 • Published 1 month ago

pubq v1.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

PUBQ JavaScript SDK

PUBQ is a pub/sub channels cloud and this is the official JavaScript client library including both real-time and REST interfaces.

To meet PUBQ and see more info and examples, please read the documentation.

Getting Started

Follow these steps to just start building with PUBQ in JavaScript or see the Quickstart guide which covers more programming languages.

Install with package manager

Use any package manager like npm or yarn to install the JavaScript SDK.

Npm:

npm i pubq

Yarn:

yarn add pubq

Import as ES module:

import { Pubq } from "pubq";

Import from CDN:

<script src="https://cdn.jsdelivr.net/npm/pubq@latest/build/browser/pubq.min.js"></script>

Interacting with PUBQ

Get your application API key from PUBQ dashboard by creating a new app or use existing one.

Connect to PUBQ:

const realtime = new Pubq.RealTime({ key: "YOUR_API_KEY" });

Subscribe to a channel and listen for any data publishing to receive:

let channel = realtime.channels.get("my-channel");
channel.subscribe((message: any) => {
    console.log({ message });
});

Publish a message:

channel.publish("Hello!");

Publish a message with REST interface:

const rest = new Pubq.REST({ key: "YOUR_API_KEY" });

let channel = rest.channels.get("my-channel");

channel.publish("Hello!");

Development

Please, read the contribution guide.

Install

git clone git@github.com:pubqio/pubq-js.git
cd ./pubq-js/
npm i

Build

To build umd bundles, run:

npm run build
1.0.19

1 month ago

1.0.18

1 month ago

1.0.17

1 month ago

1.0.16

1 month ago

1.0.11

1 month ago

1.0.15

1 month ago

1.0.14

1 month ago

1.0.13

1 month ago

1.0.12

1 month ago

1.0.10

2 months ago

1.0.9

2 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago