title: ReferenceError: firebase is not defined in cloud functions
body: <p>I am new to firebase but when I deploy my functions and execute <code>onWrite()</code> method this is the error I get: </p>
  
  <blockquote>
    <p>ReferenceError: firebase is not defined
        at exports.sendJobNotification.functions.database.ref.onWrite.event
    (/user_code/index.js:11:3)
        at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:35:20
        at process._tickDomainCallback (internal/process/next_tick.js:135:7)</p>
  </blockquote>
  
  <hr>
  
  <pre><code>const functions = require('firebase-functions');
  
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  exports.sendPaymentNotification = functions.database.ref('payments/{paymentID}').onWrite(event =&gt; {
      if (event.data.previous.exists()) {
          return;
        }
  
        firebase.database().ref('payments').child(event.params.paymentID).once('value').then(function(snap){
              var jobData = snap.val();
              console.log(jobData)
        });
  });
  </code></pre>