title: ReferenceError: global is not defined with Stream and Angular 7.1
body: <p>I'm trying to use Stream with Angular 7, however I am getting the following error.</p>
  
  <blockquote>
    <p>ReferenceError: global is not defined
    ReferenceError: global is not defined
        at Object../node_modules/faye/src/util/browser/event.js (event.js:45)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Object../node_modules/faye/src/protocol/client.js (client.js:8)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Object../node_modules/faye/src/faye_browser.js (faye_browser.js:9)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Object../node_modules/getstream/lib/lib/client.js (client.js:25)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Object../node_modules/getstream/lib/getstream.js (getstream.js:6)
        at <strong>webpack_require</strong> (bootstrap:83)
        at resolvePromise (zone.js:814)
        at resolvePromise (zone.js:771)
        at zone.js:873
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
        at Object.onInvokeTask (core.js:16147)
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
        at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
        at drainMicroTaskQueue (zone.js:595)</p>
  </blockquote>
  
  <p>I am using the package "getstream" from npm version 4.1.0.</p>
  
  <p>Here is a snippet of code and how I am referencing it.</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Constants } from './../constants';
  import * as stream from 'getstream';
  
  @Injectable({
    providedIn: 'root'
  })
  export class ActivityService {
    userToken: string;
    streamClient: stream.Client;
  
    constructor(public azureService: AzureService) { 
      console.log("Activity Service");
    }
  
    async initializeClient() {
      try {
        await this.getUserToken();
  
        if (this.userToken) {
          this.streamClient = await stream.connect(Constants.streamKey, this.userToken, Constants.streamAppId);
        }
      }
      catch (error) {
        console.log('Error creating stream client - ', error);
        throw error;
      }
    }
  </code></pre>
  
  <p>I've tried declaring global but I am not sure what else to try.  What's the proper way to import and use Stream in this case?</p>