title: Use Storage with Google Cloud Functions for Firebase
body: <p>I see a lot of controversial documentation about using Storage with Cloud Functions. I really don't understand which documentation I should to use. Anyway I think I've tried all of them and nothing is working. Please help me. 
  For example: I'm trying to use this docs: <a href="https://firebase.google.com/docs/storage/admin/start" rel="nofollow noreferrer">https://firebase.google.com/docs/storage/admin/start</a></p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp();
  const database = admin.database();
  
  var bucket = admin.storage().bucket("my-custom-bucket");
  </code></pre>
  
  <p>I have the error </p>
  
  <blockquote>
    <p>Unhandled error TypeError: storage.bucket is not a function</p>
  </blockquote>
  
  <p>If I see this docs: <a href="https://firebase.google.com/docs/storage/extend-with-functions" rel="nofollow noreferrer">https://firebase.google.com/docs/storage/extend-with-functions</a>.</p>
  
  <p>What's that? </p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp();
  const database = admin.database();
  const gcs = require('@google-cloud/storage')(); //!!! - is it mistype?
  const spawn = require('child-process-promise').spawn;
  const path = require('path');
  const os = require('os');
  const fs = require('fs');
  
  const bucket = gcs.bucket('fileBucket');
  </code></pre>
  
  <blockquote>
    <p>TypeError: require(...) is not a function</p>
  </blockquote>
  
  <p>but anyway even if it is mistype it will be next error:</p>
  
  <blockquote>
    <p>TypeError: gcs.bucket is not a function</p>
  </blockquote>
  
  <p>And yes I did install:</p>
  
  <pre><code>npm install --save child-process-promise
  npm install --save @google-cloud/storage
  </code></pre>
  
  <p><strong>Does anybody know how to use it? Or where is correct documentation?</strong></p>