Real-time Chat Blog

Chat App Best Practice Guide with JavaScript APIs

2 min read Michael Carroll 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

NPP and HIPAA: Notice of Privacy Practices Definition
Healthcare CategoryJan 6, 20235 min read

NPP and HIPAA: Notice of Privacy Practices Definition

A Notice of Privacy Practices (NPP) is one of the requirements of HIPAA and helps patients understand their personal data rights.

Michael Carroll

Michael Carroll

HIPAA Violation Examples
Healthcare CategoryJan 5, 20236 min read

HIPAA Violation Examples

HIPAA violations can be financially expensive and devastating to a brand. Examine some examples of HIPAA violations, and learn...

Michael Carroll

Michael Carroll

HIPAA Technical Safeguards: How To Protect Sensitive Data
Healthcare CategoryJan 5, 20236 min read

HIPAA Technical Safeguards: How To Protect Sensitive Data

HIPAA covered entities must follow the five technical safeguards to achieve HIPAA compliance and prevent data corruption.

Michael Carroll

Michael Carroll