Chat and Collaboration

Chat and Collaboration

Flexible and feature-rich realtime chat APIs for web, iOS, Android and connected devices

Integrate realtime chat and collaboration into your products and applications with PubNub APIs and a global network to power them. Build innovation with our suite of realtime features and we'll handle the resilient, global network infrastructure to deliver more engaging and immersive experiences.

What You Can Do with PubNub

.
Cross-Platform Messaging

70+ supported SDKs, including JavaScript, iOS, Android, and AngularJS.

.
Private and Public Chat

Group chat, private channels, and direct messages.

.
Typing Indicators and User Status

Online/offline updates, availability status, and typing indicators.

.
Chat History

Store and retrieve message history.

.
Alerts and Notifications

Send push notifications and in-app alerts.

.
Integrate with 3rd Party APIs

Add functionality from other APIs and web services.

.
Add AI and Chatbot Capabilities

Integrate automated chatbot conversation or AI analysis of messages.

.
Token-Based Access Control

Grant/revoke access to private or group chats.

Ideal Use Cases

Ideal Use Cases

Social Chat

  • Multiplayer in-game messaging
  • Live-blogging

Enterprise Chat

  • Helpbots
  • Customer and helpdesk support

B2C Chat and Instant Messaging

  • Private 1:1 chat
  • Group chat
  • Chatbots
Enhance Chat with PubNub Functions
Enhance Chat with PubNub Functions

Enhance Chat with PubNub Functions

Functions allow you to route, filter, transform, augment, aggregate, and transform messages in-motion, without the headache of managing servers and infrastructure.


Functions runs entirely in the PubNub DSN. With the click of a button, analyze and moderate text, categorize images, or even add cognitive AI capability.


Full Encryption

End-to-end encryption with TLS/SSL and AES security

  • const pubnub = new PubNub({
  • subscribeKey: 'subscribeKey',
  • publishKey: 'publishKey',
  • cipherKey: 'cipherKey' //secret key used to create AES signature
  • });

Security is Paramount

Secure and Encrypted

Industry standard TLS/SSL encryption, with optional AES.


Safe and Compliant

HIPAA Compliance, SOC II Compliant, Data Shield certified, and EU-only Data Storage options.

How It Works (In a Nutshell)

PubNub Pub/Sub messaging is at the core of chat. From there, you can add additional features like Presence (online/offline user list, typing indicators), Storage & Playback (message history), and Functions (in-network processing).

  • JavaScript
  • Android
  • iOS
  • .Net
  • Other
  • 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!');
  • });
  • pubnub.publish()
  • .message(Arrays.asList("Hello, world!"))
  • .channel("ChatRoomChannel")
  • .shouldStore(true)
  • .usePOST(true)
  • .async(new PNCallback<PNPublishResult>() {
  • @Override
  • public void onResponse(PNPublishResult result, PNStatus status) {
  • if (status.isError()) {
  • // something bad happened.
  • System.out.println("error happened while publishing: " + status.toString());
  • } else {
  • System.out.println("publish worked! timetoken: " + result.getTimetoken());
  • }
  • }
  • });
  • pubnub.publish("Hello, world!", toChannel: "ChatRoomChannel", completion: { (status) in
  • if status.isError {
  • // Handle error
  • return
  • }
  • })
  • string[] arrayMessage = new string[] {
  • "Hello",
  • "world!"
  • };

  • pubnub.Publish()
  • .Message(arrayMessage.ToList())
  • .Channel("ChatRoomChannel")
  • .ShouldStore(true)
  • .UsePOST(true)
  • .Async(new PNPublishResultExt(
  • (result, status) => {
  • // Check whether request successfully completed or not.
  • if (status.Error) {
  • // something bad happened.
  • Console.WriteLine("error happened while publishing: " + pubnub.JsonPluggableLibrary.SerializeToJsonString(status));
  • } else {
  • Console.WriteLine("publish worked! timetoken: " + result.Timetoken.ToString());
  • }
  • }
  • ));
  • /***************
  • For all other languages, check out the 70+ SDKs that PubNub supports on our documentation page
  • ****************/
Publish
  • JavaScript
  • Android
  • iOS
  • .Net
  • Other
  • pubnub.addListener(new SubscribeCallback() {
  • @Override
  • public void status(PubNub pubnub, PNStatus status) {
  • if (status.getCategory() == PNStatusCategory.PNUnexpectedDisconnectCategory) {
  • // This event happens when radio / connectivity is lost
  • // Handle error here
  • return;
  • }
  • }
  • @Override
  • public void message(PubNub pubnub, PNMessageResult message) {
  • System.out.println("Received my message!! " + message.toString());
  • }
  • });
  • pubnub.subscribe()
  • .channels(Arrays.asList("ChatRoomChannel")) // subscribe to channels
  • .execute();
  • class Listener: NSObject, PNObjectEventListener {
  • func client(_ client: PubNub, didReceive status: PNStatus) {
  • if status.isError {
  • // Handle error
  • return
  • }
  • }

  • func client(_ client: PubNub, didReceiveMessage message: PNMessageResult) {
  • print("Received message!!! \(message.debugDescription)")
  • }
  • }
  • let myListener = Listener()
  • client.addListener(myListener)
  • client.subscribeToChannels(["ChatRoomChannel"], withPresence: true)
  • SubscribeCallbackExt listenerSubscribeCallack = new SubscribeCallbackExt(
  • (pubnubObj, message) => {
  • // Handle new message stored in message.Message
  • },
  • (pubnubObj, status) => {
  • // Handle error
  • });

  • pubnub.AddListener(listenerSubscribeCallack);
  • pubnub.Subscribe<string>()
  • .Channels(new string[] {
  • // subscribe to channels
  • "ChatRoomChannel"
  • })
  • .Execute();
  • /***************
  • For all other languages, check out the 70+ SDKs that PubNub supports on our documentation page
  • ****************/
Subscribe

All our APIs are powered by our Data Stream Network, with 15 points-of-presence across the globe.

.

"PubNub is one of those systems that we set up and at this point I think about it so rarely, it just runs and everything works".

Ze’ev Klapow

Senior Software Engineer, HubSpot

Yelp

Yelp uses PubNub to connect owners and consumers.

Ebay

Ebay uses PubNub to power live chat between sellers and buyers.

One Drop

One Drop built a HIPAA-compliant mobile app to track and analyze patient diabetes data.

View More Customers

Getting Started

Feature Rich Chat App with React
Feature Rich Chat App
with React

A comprehensive guide to building a feature-rich chat application for web and mobile using the React framework.


Functionality:
  • Send and receive chat messages
  • User detection (online/offline status)
  • Friend lists
  • Infinite scroll
  • Typing indicators
Read More
Java Script
Feature Rich Chat App
with JavaScript

A use-cases based guide for building individual chat features into your web chat app.


Functionality:
  • Send and receive chat messages
  • User detection (online/offline status)
  • Message history
  • Security
  • Push Notifications
Read Docs
AngularJS
Feature Rich Chat App
with AngularJS

A more comprehensive tutorial for building a feature-rich chat app for web, including a number of additional chat features.

Functionality:
  • Send and receive chat messages
  • User detection (online/offline status)
  • Friend lists
  • Typing indicators
  • User authentication and security
Read Docs
iOS
Fully-Featured iOS Chat App

This training webinar walks through building a mobile group chat app for iOS.

Functionality:
  • Send and receive chat messages
  • User detection (online/offline status)
  • Message history
View Webinar
Android
Fully-Featured Android Chat App

This training webinar walks through building a mobile group chat app for Android in Java.

Functionality:
  • Send and receive chat messages
  • User detection (online/offline status)
  • Message history
View Webinar

Try PubNub Today

Connect up to 100 devices for Free