New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webpubsub-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpubsub-js

Publish & Subscribe Real-time Messaging with Webpubsub

latest
Source
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

Webpubsub JavaScript SDK (V4)

Build Status Codacy Badge npm Bower Known Vulnerabilities

This is the official Webpubsub JavaScript SDK repository.

Webpubsub takes care of the infrastructure and APIs needed for the realtime communication layer of your application. Work on your app's logic and let Webpubsub handle sending and receiving data across the world in less than 100ms.

Get keys

You will need the publish and subscribe keys to authenticate your app. Get your keys from the Admin Portal.

Configure Webpubsub

  • Integrate the JavaScript SDK into your project:

    • use npm:
      npm install webpubsub
      
    • or download one of our builds from our CDN:
  • Configure your keys:

webpubsub = new Webpubsub({
  publishKey : "myPublishKey",
  subscribeKey : "mySubscribeKey",
  uuid: "myUniqueUUID"
})

Add event listeners

webpubsub.addListener({
  message: function (m) {
    // handle messages
  },
  presence: function (p) {
    // handle presence  
  },
  signal: function (s) {
    // handle signals
  },
  objects: (objectEvent) => {
    // handle objects
  },
  messageAction: function (ma) {
    // handle message actions
  },
  file: function (event) {
    // handle files  
  },
  status: function (s) {
  // handle status  
  },
});

Publish/subscribe

var publishPayload = {
    channel : "hello_world",
    message: {
        title: "greeting",
        description: "This is my first message!"
    }
}

webpubsub.publish(publishPayload, function(status, response) {
    console.log(status, response);
})

webpubsub.subscribe({
    channels: ["hello_world"]
});

Documentation

Support

If you need help or have a general question, contact support@webpubsub.com.

Keywords

cloud

FAQs

Package last updated on 07 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts