GithubHelp home page GithubHelp logo

kratuldev / firebase-remote-config-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebay/firebase-remote-config-monitor

0.0 0.0 0.0 1.24 MB

Monitors firebase remote config values, posting changes to slack

License: Apache License 2.0

JavaScript 100.00%

firebase-remote-config-monitor's Introduction

Firebase Remote Config Monitor

Firebase Cloud Function built on node 8 which will automatically post any changes to Firebase Remote Config to Slack.

Project Name had 2 changes
Condition Added: SampleCondition
Firebase User {
   "expression": "device.os == 'android' && percent <= 50",
   "tagColor": "CYAN",
   "position": 23
}
Parameter Added: SampleParameter
{
   "defaultValue": {
   "value": "true"
},
   "conditionalValues": {
      "SampleCondition": {
         "value": "false"
      }
   }
} version 23

Usage

To use this, you must deploy this as a Firebase Cloud Function. For details on enabling Cloud Functions for Firebase, see Google's documentation. This function will automatically subscribe to Remote Config's onUpdate function and post changes any changes to remote config to the specified Slack channel.

Setup Steps

This app is powered by a combination of Cloud Functions for Firebase and the Firebase Remote Config API. You will need to be an administrator on your Firebase Console account to perform the following steps.

Enable Firebase Remote Config API

This app uses the Firebase Remote Config API which must be enabled on your google API project prior to running the app.

  • Visit the Google APIs dashboard at: https://console.developers.google.com/apis/dashboard
  • Select the project you wish to enable this for, (this will be the same name as your Firebase Console project)
  • Select Firebase Remote Config API from the list of APIs
  • Enable this API
    • Note: this may take a few minutes to take effect.

If you do not have this enabled, or the update has not had time to take effect, you will receive an error in the Cloud Function's logs when this function attempts to run.

Generate a Slack webhook URL

This app will post to the webhook URL defined within the config file. The payloads this app creates are crafted for Slack.

To create a Incoming webhook follow the steps detailed by Slack at https://api.slack.com/incoming-webhooks

You need to modify the slack_config.json file with the webhook created. You also will add the display name for the project you would like to see when the function posts to slack. The config should look like:

{
	"slackWebHookUrl": "https://hooks.slack.com/services/your/webhook/url",
	"siteDisplayName": "Your Project's Display Name"
}

Cloud function Installation

To deploy your cloud function follow the steps documented by Google from the commandline in the base project directory. Be sure to select lanaguage Javascript and do not overrwrite the index.js or package.json file when prompted.

The last step should be running the command firebase deploy --only functions which will deploy your function to firebase.

To see the function in action, go to the Remote Config section of your firebase console, and then make and publish a change to your remote config values.

Testing

Firebase Remote Config Monitor is tested with the Mocha for scenario definition and Sinon for dependency injection.

npm install
npm test

License

© 2018 eBay Inc. Developer: Jake Hall

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. See the LICENSE file for more details.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

firebase-remote-config-monitor's People

Contributors

amanbhawsar99 avatar frindly avatar iarredondocastro avatar wevenwang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.