title: Javascript - Firebase Functions on how to get user id
body: <p>I want to define custom functions on Firebase using firebase-tools. Is there a way to get userId from <a href="https://firebase.google.com/docs/reference/functions/functions.auth" rel="nofollow noreferrer">firebase-functions</a>? </p>
  
  <p>Say on this code sample, is it possible to get the user who sent the request? </p>
  
  <pre><code>const functions = require('firebase-functions');
  
      exports.helloWorld = functions.https.onRequest((request, response) =&gt; {
       response.send("Hello from Firebase!");
      });
  </code></pre>
  
  <p>I have tried getting it with the following code unsuccessfully <code>functions.auth.user().uid</code>.</p>
  
  <p>I am quite new to both js and firebase, so go easy on me please, I am trying to learn.</p>