7.1.2 • Published 4 months ago

@pubq/pubq-js v7.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months 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/pubq-js

Yarn:

yarn add @pubq/pubq-js

Import as ES module:

import { Pubq } from "@pubq/pubq-js";

Import from CDN:

<script src="https://cdn.jsdelivr.net/npm/@pubq/pubq-js@latest/bundle/pubq.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 a channel:

let channel = realtime.subscribe("my-channel");

Listen for any data publish to receive:

(async () => {
    for await (let data of channel) {
        console.log({ data });
    }
})();

Publish a message:

realtime.publish("my-channel", "Hello!");

Publish a message with REST interface:

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

rest.publish("my-channel", "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
7.1.2

4 months ago

7.1.1

5 months ago

7.1.0

5 months ago

5.1.0

8 months ago

6.0.0

8 months ago

4.0.1

9 months ago

4.0.0

9 months ago

4.0.3

9 months ago

4.0.2

9 months ago

7.0.0

5 months ago

1.2.0

12 months ago

3.0.0

11 months ago

2.0.3

11 months ago

2.1.1

11 months ago

2.0.2

11 months ago

2.1.0

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago