Real-time Chat Blog

Chat App Best Practice Guide with JavaScript APIs

2 min readPubNub Staff on Apr 28, 2016
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

Good News! We've launched an all new Chat Resource Center. We recommend checking out our new Chat Resource Center, which includes overviews, tutorials, and design patterns for building and deploying m...

Waving Hand

Good News! We’ve launched an all new Chat Resource Center.

We recommend checking out our new Chat Resource Center, which includes overviews, tutorials, and design patterns for building and deploying mobile and web chat.

Take me to the Chat Resource Center →

One of the most common use-cases of PubNub data stream network is for chatting. It can be a standalone chat app, or a chat feature in a larger application or website. A good example of latter is the one seen on Twitter Periscope, where viewers can interact with the videocaster during a live video stream.

Periscope powered by PubNub

Simulated image from an screenshot from Periscope by Monterey Bay Aquarium

We work hard to make it easy for you to build your own apps, however, nothing is too easy- we get questions from many of you every day. Especially, PubNub’s support superstars, Craig, Fred, and Eric are wrangling tough questions nearly 24/7!

So I picked up the common features that used in chat apps, and wrote up a use-cases based best practice guide. It should answer your “Which PubNub API should I use to build XX feature?” questions.

The guide includes basic chat features like, “Joining a chat room”, “Displaying how many users are currently online”, to “Retrieving past messages”, also features that improve your app’s user experience, such as “Showing an indicator when someone is typing”, as well as information on how to make your users chat messages secure, for example with using AES cryptography.

Speaking of encrypted chat apps, you may have heard the recent news about WhatsApp started encrypting all messages for their 1 billion users. Now, the chat messages are protected and only accessible to the users in the chat, not exposed to outsiders.

The secure end-to-end encryption is built into the PubNub SDK, so you do not need to deal with the complexity of encrypting and decrypting the data by yourself. You can just set it by setting a single flag!

So if you are building chat apps, or apps that comes with a chat feature, read on!

Encrypted Chat App in JavaScript Best Practice Guide Doc:
Encrypted Chat App in JavaScript Best Practice Guide

More from PubNub

How to Advance Telehealth and Virtual Care Technologies
News May 2, 20221 min read

How to Advance Telehealth and Virtual Care Technologies

Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...

PubNub Staff

PubNub Staff

Another Step Towards Data Security: ISO-27001 Implementation
BuildMay 2, 20221 min read

Another Step Towards Data Security: ISO-27001 Implementation

Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.

PubNub Staff

PubNub Staff

Improving Virtual Care in a Post-Pandemic World
News Apr 14, 20221 min read

Improving Virtual Care in a Post-Pandemic World

Meg Barron, VP of Digital Health Strategy at the AMA, talks with PubNub’s COO, Casey Clegg, about what’s next for the healthcare...

PubNub Staff

PubNub Staff