# @realmq/web-sdk

> The RealMQ web sdk for building realtime browser apps. This sdk provides developer friendly access to REST & Realtime APIs of realmq.com.

Latest version **0.2.0** (published 2023-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @realmq/web-sdk
pnpm add @realmq/web-sdk
yarn add @realmq/web-sdk
bun add @realmq/web-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-03-12 |
| First published | 2018-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 443 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | RealMQ GmbH |
| Maintainers | realmq-ci, a-z, baranga, derlarsen |
| Keywords | realtime, realmq, api, sdk, mqtt, broker |

## Links

- npm: https://www.npmjs.com/package/@realmq/web-sdk
- Repository: https://github.com/realmq/realmq-web-sdk
- Homepage: https://github.com/realmq/realmq-web-sdk#readme
- Issues: https://github.com/realmq/realmq-web-sdk/issues
- npm.io page: https://npm.io/package/@realmq/web-sdk

## Dependencies (3)

- [promise](https://npm.io/package/promise.md) ^8.0.1
- [base64-js](https://npm.io/package/base64-js.md) ^1.5.1
- [paho-mqtt](https://npm.io/package/paho-mqtt.md) ^1.1.0

## 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

- 0.2.0 (latest) — 2023-03-12
- 0.1.0 — 2018-06-29
- 0.1.0-alpha7 — 2018-04-20
- 0.1.0-alpha6 — 2018-04-14
- 0.1.0-alpha5 — 2018-04-14
- 0.1.0-alpha4 — 2018-04-14
- 0.1.0-alpha3 — 2018-04-13
- 0.1.0-alpha2 — 2018-04-13
- 0.1.0-alpha1 — 2018-04-13

## README

# RealMQ Web SDK

[![NPM Package](https://img.shields.io/npm/v/@realmq/web-sdk.svg?style=flat-square)](https://www.npmjs.com/package/@realmq/web-sdk)
[![Build Status](https://img.shields.io/travis/realmq/realmq-web-sdk/master.svg?style=flat-square)](https://travis-ci.org/realmq/realmq-web-sdk)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![MIT license](https://img.shields.io/github/license/realmq/realmq-web-sdk.svg?style=flat-square)](LICENSE)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frealmq%2Frealmq-web-sdk.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Frealmq%2Frealmq-web-sdk?ref=badge_shield)

This web SDK provides developer friendly access the RealMQ REST & Real-time APIs.

## About

[RealMQ](https://realmq.com) is a highly scalable, privacy compliant real-time communication backbone.
Our focus is to deliver great service with best possible integrability while you keep full control over your data.

## Getting Started

Get in touch with us to get an RealMQ account set up.
You can do that by sending an email to service@realmq.com.

### Installation

The easiest way to include the realmq web sdk to your page is to load it from unpkg.com.

```html
<script src="https://unpkg.com/@realmq/web-sdk/dist/realmq.min.js"></script>
```

You can also use the npm module to integrate it in your custom frontend build pipeline (eg. browserify).

```bash
$ yarn add @realmq/web-sdk
// or
$ npm i -S @realmq/web-sdk
```

### Usage

```js
const realmq = new RealMQ('<AUTH_TOKEN>');

// create some resource
const subscription = await realmq.subscriptions.create({
  userId: 'user-1',
  channelId: 'channel-1',
  allowRead: true,
});

// or connect to the real-time API
await realmq.rtm.connect();

// and publish some message
realmq.rtm.publish({
  channel: 'channel-1',
  message: {
    text: 'Welcome!'
  }
});

// receive messages
realmq.rtm.on('message', (message) => {
  console.warn(`received new message in channel: ${message.channel}`, message.data)
});
```

## Documentation

Please check out our full documentation on [realmq.com/docs/web-sdk](https://realmq.com/docs/web-sdk).

### Credits

This SDK utilies and bundles the following awesome libs

* [base64-js](https://github.com/beatgammit/base64-js) ([License](https://github.com/beatgammit/base64-js/blob/master/LICENSE))
* [paho.mqtt.javascript](https://github.com/eclipse/paho.mqtt.javascript) ([License](http://www.eclipse.org/org/documents/edl-v10.php))
* [promise](https://github.com/then/promise) ([License](https://github.com/then/promise/blob/master/LICENSE))

---

### LICENSE

The files in this archive are released under MIT license.
You can find a copy of this license in [LICENSE](LICENSE).


[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frealmq%2Frealmq-web-sdk.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frealmq%2Frealmq-web-sdk?ref=badge_large)

---
_Source: https://npm.io/package/@realmq/web-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
