title: Retrieving a Firebase storage image link via Cloud Function
body: <p>How do I retrieve the download links to stored images in Firebase via a cloud function?</p>
  
  <p>I've tried all kinds of variations including the next one:</p>
  
  <pre><code>exports.getImgs = functions.https.onRequest((req, res) =&gt; {
      var storage = require('@google-cloud/storage')();
  
  var storageRef = storage.ref;
  
  console.log(storageRef);
  
  storageRef.child('users/user1/avatar.jpg').getDownloadURL().then(function(url) {
  
      });
  });
  </code></pre>