title: Abortable Fetch in firebase cloud function
body: <p>I'm using <a href="https://developers.google.com/web/updates/2017/09/abortable-fetch" rel="nofollow noreferrer">abortable fetch</a> to timeout fetch queries that are taking too long. </p>
  
  <p>Can <code>AbortController</code> be called within Firebase functions?</p>
  
  <p>Cloud Function:</p>
  
  <pre><code>exports.afterLike = functions.firestore
  .document('users/{userId}/posts/{postId}')
  .onUpdate(async (change, context) =&gt; {
  
      ...
  
      const abortCtrl = new AbortController();
      const signal = abortCtrl.signal;
      const timeout = setTimeout(() =&gt; {
          abortCtrl.abort()
      }, 8000)
  
      fetch('https://posturl.com/api', {
          signal: signal,
          likeId: "123456"
      })
  })
  </code></pre>
  
  <p>But AbortController is undefined. here is the firebase function error:</p>
  
  <pre><code>ReferenceError: AbortController is not defined
      at res.forEach (/srv/index.js:76:28)
      at &lt;anonymous&gt;
      at process._tickDomainCallback (internal/process/next_tick.js:229:7)
  </code></pre>