Connecting Firebase To Slack With Node

Posted by:

For a recent project, we needed to send various types of user feedback to corresponding Slack channels from a single page HTML5 app.

Since Slack webhook endpoints must be hidden, this can’t be done directly from the browser without revealing that URL and inviting spammers to flood the Slack channels.

The application was not running a traditional backend, but rather being served statically and talking to Firebase via its API to store and retrieve data. The solution was to write the messages to Firebase and create a ‘postman’ application in NodeJS, which periodically checked the database for unread messages, sends them to the appropriate Slack channel, and marks them read.

For a deep dive into the solution, with code, see my article on DZone: https://dzone.com/articles/securing-slack-webhooks-with-firebase-and-nodejs

0

About the Author:

Since the early ’80s, my consuming passion has been programming. Today I work as a Software Architect, bringing more than 30 years of industry experience to bear on every task. My career has run the gamut from writing games in machine language for Commodore 64 and Apple II to implementation of large scale, object-oriented, enterprise applications. In my spare time, I am an author and occasional music producer.