DIY Chat Application for Customer Sales and Support

5 min read Stephen Blum on Nov 20, 2014

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 →

Question: “How can I use PubNub for making a customer support chat application which has basic features like ClickDesk and Pure Chat?”

These apps are online live chat applications with a different set of features, such as video, voice, and social integrations. Well good news is, that’s right up PubNub’s alley. With PubNub, you can easily build and scale fully featured chat applications. That’s what we’ll do in this demo.

Creating a SaaS Business Chat Application for Customer Sales & Support Using PubNub

There is a lot to be considered when building a SaaS solution for customer support and sales communication.  Your key focus must be on user experience for two types of recurring users: Desk Agents and Customer Prospects.

The “Agent” experience will include a GUI for easy administration and management of multiple conversation threads. The customer, or “Prospect” experience should be easy and minimal inbound and outbound communication including email/SMS/voice and other standard collaboration mediums.

Agent Admin (Sales/Support) Experience

chat application

The support and sales role needs to have views into the past history and active threads of each conversation.

chat application

Note the complexity of the administrative view vs. simplicity of the customer’s view. Also you’ll want a Mobile App for your Agents!

In addition to the standard consumer experience you’ll need to create more components that connect with user’s every day communication patterns and business requirements.  Email controllers and email parsers, connectors/plugins for CRMs like Salesforce, widgets and integrations with web form, web chat plugin, group chats, mobile GUIs and more.

Secure Chat Communication is Priority Number One

You must make the user-to-user communication process as seamless as possible.  This is the primary purpose of the SaaS customer support solution.  Also don’t forget that security is crucial and expected.

PubNub helps you with a global data stream network for building a chat application (or any solution) that requires secure user-to-user real-time communication, including:

  1. User-to-user communication
  2. Secure ACL access controls and access management
  3. Online connectivity presence detection
  4. Reliable chat with global access and multiple points of presence
  5. Storage and playback of historical user conversation threads
  6. End-to-end encryption and encryption at-rest on disk
  7. HIPAA ISO and similar regulatory compliances
  8. Mobile push notifications
  9. Remote commands and mediation from a server

Getting started with PubNub is easy.  You don’t need any servers, just your unique PubNub API keys. You’ll first need to sign up for a PubNub account. Once you sign up, you can get your unique PubNub keys in the PubNub Developer Portal.

Next you’ll want to access the PubNub connector SDKs which allow your Mobile Apps and Web Apps to communicate between users, independent of mobile or web platforms!

PubNub Resources for Getting Started

  1. Sign up for a free account and get your API Keys

Download mobile app and web app SDKs

  1. iOS SDK for Real-time Chat Apps
  2. Android SDK for Real-time Chat Apps
  3. JavaScript/PhoneGap SDK for Real-time Chat Apps

Optional server-side PHP, Ruby, Node.JS, Python

  1. PHP SDK for Chat Apps
  2. Python SDK for Chat Apps
  3. Ruby SDK for Chat Apps
  4. Node.JS SDK for Chat Apps

See all our other SDK options for PubNub chat real-time app communications: Real-time Software Development Resources, Tutorials & SDKs

PubNub uses the “channel” as the namespace communication pathway between each party member of a conversation. Group chats and one-to-one messaging occur over PubNub “Channels.” You’ll need to decide how to organize your channel naming practices to best setup a conversation between two or more users.

Connecting a Desk Support Agent with a Prospective Customer

To connect an agent with a prospect, one option is to have a dedicated always-on “AGENT” channel. The “AGENT” channel will be opened via the PubNub SDK in your Agent’s Dashboard.

After the Agent is subscribed to the “AGENT” channel, the Prospect Customer is now able to send the Agent a signal indicating to initiate a chat.  The Prospect Customer can do this with the PubNub Publish API call which sends an invitation for a chat conversation.

The Prospect Customer will subscribe to a uniquely generated channel name and publish this to the “AGENT” channel to all the Agent to begin a chat with the Prospect Customer.

Now the Agent can Publish to the Prospect Customer’s unique channel name to accept the conversation request.

Now the conversation has been started between the Support/Sales Agent and the Customer Prospect.

Conversation History: Storage & Playback

To get historical conversations you can use PubNub Storage & Playback by calling the history methods. You can learn more about Storage and Playback features from PubNub by reading JavaScript Storage & Playback documentation.

User Connection Presence Detection: Leave/Join Events

You’ll also need online and offline detection for users in your chatroom. You can also get the connectivity presence state of users to detect if a customer prospect drops a conversation by closing/leaving without saying goodbye. See more about Presence Detection with JavaScript Presence Detection for Real-time Chat Apps.

This will allow you to receive join, leave and state events on the customer prospect’s communication channel. Also you can issue a “quick line check” on the Prospect’s channel by using a “HereNow” method call.

HereNow calls will allow you to capture the prospect’s status on the channel connection with the option of custom status settings using JavaScript Presence State Event Detection and notifications.

Chat Security

Protect your apps with enterprise-grade encryption and fine-grain access controls to protect your agent user’s privacy over the internet.

  • Chat communication encryption, including built-in AES encryption for all major PubNub APIs and optional TLS encryption.
  • Access Manager for fine grain read and write chat message permissions down to agent and prospect’s device or channel.
  • Physical security & compliance, including SSAE 16 certified data centers and strict operations policies for compliance with international regulatory laws and practices.

Using Access Manager to grant and revoke access to data stream channels is easy using our included access control methods in the PubNub SDKs. You’ll use your PubNub Secret Key in order sign secure access requests for granting READ and/or WRITE access on a PubNub data stream channel.

Grants read and write permissions for 5 minutes.  You can define the auth_key as any string value. The recommendation is a long and unpredictable string value for the auth_key.

More PubNub Resources for Chat Communication Apps

See All SDK options for PubNub chat real-time app communications: Real-time Software Development Resources, Tutorials & SDKs