title: How to manage database configurations for different projects in Firebase?
body: <p>I have a firebase project that I use as backend for my mobile app. This uses cloud functions which write to and read from the realtime database. I recently had the need to deploy these to a new environment I use for development so that I can continue working on my app without accidentally breaking my users' experience. </p>
  
  <p>My firebaserc file now looks as follows: </p>
  
  <pre><code>{
      "projects": {
          "prod": "my-cool-app",
          "dev": "my-cool-app-dev"
      }
  }
  </code></pre>
  
  <p>The problem I'm having right now is that my database configuration is hardcoded in the code itself as below:</p>
  
  <pre><code>var config = {
      apiKey: "AIzaSomething something",
      authDomain: "my-cool-app.firebaseapp.com",
      databaseURL: "https://my-cool-app.firebaseio.com/"
  };
  
  firebase.initializeApp(config);
  </code></pre>
  
  <p>Because this does not change no matter what project I deploy, it means that both Production and Development end up writing to the same database. </p>
  
  <p>I tried to search how to handle different database configurations but had no luck. </p>