Slack Chat: Chatting with Visitors on a Drupal Site

Since we switched to Slack as the primary means of communication at work, Slack has grown to be my favorite chat application. Not only does it have a very pleasant interface, but it also offers great ways to integrate it with your application. As a matter of fact, their API is among the least restrictive ones in my experience. As a result of the joy of working the Slack API, Slack chat module was born to serve as a proof of concept for embedded Drupal-to-Slack chat functionality.

Using Slack chat module, you can add a chat widget to your Drupal site that your visitors can use to chat with users in Slack. This can allow you to provide live chat customer support to your visitors directly from Slack, without having to log in to the Drupal site. The module creates a channel in Slack for each visitor, so multiple people in Slack can join or oversee the conversation. 

Slack chat module

The module depends on Node.js integration module to deliver messages to the visitor in real-time. Once Slack chat module is installed, the Node.js server application (part of Node.js integration module) acts as a Slack bot that's constantly online and processes events coming from Slack.  Another approach I considered for this purpose was outgoing webhooks. However, I found that too limiting because outgoing webhooks only trigger in a specific channel, or for messages prefixed with a certain word. It would have been cumbersome to have all visitors chat in the same channel, or require Slack users to prefix all messages with a command word. The Slack bot approach, on the other hand, provides for a seamless experience and also precludes the need to constantly poll for new messages.

If you use Slack and have a website, be sure to check out Slack chat module, and let me know your thoughts.