Introducing console-to-slack: Slack webhooks for the JavaScript console

|

We are very excited to announce console-to-slack, our first package of the year! One of our main goals for 2017 is to contribute more to the open-source community, so it is a good first step to be contributing this early in the new year. As an organization that has invested a lot into the open-source movement, we are excited for its future and how we can play our part.

So, what exactly is console-to-slack and how do we use it here at TechChange? Console-to-slack is a small module that utilizes Slack’s webhooks to send anything that normally is printed to the console to a Slack channel of your choice.

We recently made a push to update our authentication processes to use JSON Web Tokens (JWTs) to more align with a trusted, industry standard for authentication. As we were working on this update, we needed a way to debug our changes in real-time without having to constantly monitor our application logs. In the past, we had tried out a module which would email us with any errors, but a few thousand emails and about 30 seconds later, we decided that wasn’t the best idea.

As an organization, TechChange uses Slack for our team messaging and we take advantage of Slack webhooks to post messages to a Slack thread anytime we update one of our courses. We quickly put two and two together and about 100 lines of code later, we had a module which would post any application errors to a Slack thread, complete with an embarrassing, childhood photo of our CTO.

blah2

Our initial use case was debugging the rollout of JWTs into the world, but we soon discovered its perfect use for low-risk error monitoring and reporting. Since then, we have packaged console-to-slack as a npm module, added a few more features, and beefed up the documentation.

Despite being such a small module, console-to-slack has had a large impact on our code base and best practices as a tech team. We decided to be more intentional with our use of logging in order to filter out unnecessary messages. As a result, we discovered subtle mistakes in other sections of code that were unintended behavior.

As a developer, it is a great feeling to contribute to the open-source community and we hope that TechChange’s contributions can help fellow developers as they see fit. We highly recommend that you dig up an embarrassing photo of your CTO, should you decide to give console-to-slack a try. Stay on the lookout for more open-source contributions from TechChange throughout 2017 and enjoy!


Also on TechChange Main

4 Ways 3D Printing is Promoting Social Change

As a Star Trek fan, I found the most amazing technology on the TV show to be not the ship...

Hans Rosling at TED Talks (2010)
Liberating Data for Humans with Data Visualizations

In his 2006 TED talk, Hans Rosling used data visualizations to deconstruct his students’ assumptions about the ‘developed’ and ‘developing’...

The Nigeria Security Tracker: How (not) to Design an ICT-Enabled Project

For those interested in Technology for Peacekeeping consider taking our online certificate course, Technology for Conflict Management and Prevention, starting...