Build

The PubNub Publish/Subscribe JavaScript API Tutorial

2 min read Apr 3, 2015

pubnub javascript pub/sub api tutorialWe’ve built hundreds of tutorials using our PubNub JavaScript API, from simple chat applications, to data visualizations, to multiplayer games. The API at its core is a powerful way to stream data bidirectionally in real time between any number of connected devices.

Using the publish/subscribe design pattern, devices subscribe to a channel, and can receive data on that channel from a publisher. When it comes to a publish/subscribe JavaScript API, the use cases really are endless!

To get you started, we have a couple quick and dirty tutorials to get you sending and receiving messages via PubNub, but we wanted to do a more in-depth, comprehensive tutorial for those who wanted more. So we had two of our support gurus, Craig and Fred, host the first ever PubNub webinar.

Publish/Subscribe JavaScript Tutorial Overview

In the webinar tutorial, we go step-by-step through getting started with the PubNub JavaScript API, from signing up for a PubNub account all the way to building a simple real-time chat application. Our chat application will also implement the presence API for online user detection, and the history API to store and retrieve old chat messages.

Key topics covered will include:

  • Getting started with PubNub
  • Integrating the latest version of the SDK
  • Accessing the API
  • Initialization/subscribing to data channels
  • Publishing messages and log all sent messages over that channel
  • Presence/State detection (knowing when users enter/leave your app)
  • History (storing real-time data for future retrieval and playback)

Good news is, you didn’t have to be there live, because we recorded the whole thing!

Additional JavaScript API Resources and Tutorials

0