Firebase: How to run 'HTTPS callable functions' locally using Cloud Functions shell? : <p>I couldn't find a solution for this use case in <a href="https://firebase.google.com/docs/functions/local-emulator" rel="noreferrer">Firebase official guides</a>.</p>

<ul>
<li>They are HTTPS callable functions </li>
<li>Want to run Functions locally using Cloud Functions shell to test</li>
<li>Functions save received data to Firestore</li>
<li>The 'auth' context information is also needed</li>
</ul>

<p>My code as below. Thanks in advance.</p>

<hr>

<p><em>Function :</em></p>

<pre><code>exports.myFunction = functions.https.onCall((data, context) =&gt; {
  const id = context.auth.uid;
  const message = data.message;

  admin.firestore()...
  // Do something with Firestore //
});
</code></pre>

<p><em>Client call :</em> </p>

<pre><code>const message = { message: 'Hello.' };

firebase.functions().httpsCallable('myFunction')(message)
  .then(result =&gt; {
    // Do something //
  })
  .catch(error =&gt; {
    // Error handler //
  });
</code></pre>
