BUILD THE FUTURE

APIs and a global network powering pub/sub realtime messaging, device detection, and functions.

Free Trial SDKs Icons Guide: Building a Fully-Featured JavaScript Multiplayer Game JavaScript Multiplayer Game Tutorial
Chat and Collaboration
USE CASE

Chat and Collaboration

Build powerful and feature-rich realtime chat and collaboration apps, powered by flexible APIs and a global messaging infrastructure. Cross-device and cross-platform mean they work across web, iOS, Android, and the rest.

  • pubnub.publish({ channel: 'ChatRoomChannel', message: 'Hello, world!' }, (publishStatus) => {
  • if (publishStatus.error) {
  • console.error('Non 200 response', { publishStatus });
  • return;
  • }
  • console.log('I just published my hello!');
  • });
IoT Device Control
USE CASE

IoT Device Control

Securely monitor, control, provision and stream data between smart devices, sensor networks, hubs, and more. Trigger device action, monitor meta data, or stream and process incoming and outgoing data. PubNub provides the infrastructure and APIs for communication for any size IoT deployment.

  • # Handle PNPublishResult and PNStatus
  • def publish_callback(result, status):
  • if status.is_error():
  • # Handle error
  • return
  • print "I just received a publish callback!"
  • pubnub.publish().channel('sensor_channel').message({ temp: 400 }).async(publish_callback)
Realtime Updates
USE CASE

Realtime Updates

Keep everyone, and every device realtime. From mapping, geotracking and dispatch, to broadcasting alerts and up-to-the-millisecond updates, when something happens in the real world, it's reflected in your app.

  • pubnub.addListener({
  • status: function(statusEvent) {
  • if ((statusEvent.category === 'PNNetworkDownCategory') || (statusEvent.category === 'PNNetworkIssuesCategory')) {
  • // Handle error
  • return;
  • }
  • },
  • message: function(message) {
  • console.log('Realtime update!! ', message);
  • },
  • presence: function(presenceEvent) {
  • // handle presence
  • }
  • });
  • console.log('Subscribing..');
  • pubnub.subscribe({
  • channels: ['hello_world']
  • });
2 Trillion

Monthly Transactions

330 Million

Unique Monthly Devices

99.999%

Uptime SLAs

Try PubNub Today

Connect up to 100 devices for Free