Firebase Slack



Read Part One and Part Two of Building a Slack Bot clone using firebase and Vue.js before reading this. How to search for a word in pdf mac. To know about how to Implement the Authentication using Firebase and Vue.js view this post. The same authentication mechanism is used here to Authenticate the user.If you are new to Vue.js, I recommend reading the Vue.js Basics. With Firebase's Slack integration, your project can post to your Slack workspace in response to events in certain Firebase services, like new or regressed issues in Crashlytics. Open the Firebase Console to the Integrations page. Click Install on the Slack integration card. Paste the Webhook URL from your Slack settings page to the Webhook URL field. Enter a channel name. Firebase is popular backend service that makes authentication and data storage easy. And it all happens in real time! The application you will learn to build in this course, will be an Advance Messaging App, a slack clone.

  1. Firebase Cloud Function Slack
  2. Firebase Slack Clone
  3. Firebase Slack Login

With the release of FireStore we can now use it with cloud functions to do lots of wonders. Now, we are going to create a simple slack notification system via webhooks. Learn More.

In our previous article we saw about how to kick start with Firebase’s new add-on FireStore. Now let’s see how we can use Firestore along with cloud functions to perform a lot of background operations as well. In our use case, we’ll be creating a simple Slack notification system where the todos are created and their statuses are updated.

If you landed here directly I’d strongly recommend you to look at our previous article Getting Started with Cloud Firestore in 5 Minutes to get more information and clarity since we’ll be using the same example.

Right now we’ve a todo list where we can create and toggle status of a todo. With this example, we’ll be sending notifications to a Slack channel where a new todo is created or when a todo is marked as checked/unchecked.

Few Basic Setup.

First you need to get a Slack webhook in order to send messages to a channel or a group in your workspace. For creating the webhook follow this link.

Once the webhook is created, note it down and we’ll be using that to configure Firebase’s cloud function.

Firebase Slack

Firebase Cli

If you haven’t updated the firebase-tools before, update it with the following command.

Now create a Firebase project in folder with the following command.

Now select Firebase functions in the menu popped in terminal, once complete you’ll find a folder called functions and other configuration files.

Writing Cloud Functions

Now open the index.js file inside functions folder. this is the entry point for our cloud functions and we’ll be writing our functions here for this example.

Installing Slack SDK

Also install the Slack node sdk in the functions folder.

Configure Slack

We’ll be using the webhook url that we got from Slack for configuring the sdk.

Function to send message to Slack

Firebase Slack

We wrote a common function that we’ll be using to post messages to Slack passing the message string as parameter

Writing Cloud functions

First, in order to listen to a specific document we’ll be using the following pattern

The cloud functions for Firestore is very similar to that for realtime databases. We’ll be using two triggers - onCreate() and onUpdate() for triggering when new todo is created and when a todo’s status is toggled.

On Create

Firebase Cloud Function Slack

On Update

Also do checkout our other articles on Firebase here:

Up next

Firebase Slack Clone

The brutally honest question every CEO must answer.Firebase Slack

Firebase Slack Login

Skcripthttps://www.skcript.com/svr/send-slack-notifications-using-firebase-cloud-functions-firestore/https://www.skcript.com/svrmedia/heroes/firestoreslack.png