title: Typescript definitions for sendgrid
body: <p>I am trying to write a typescript app that uses sendgrid, but unlike with other definitions I got from <code>typings</code> the one from <code>typings install sendgrid --ambient</code> is causing me some headaches:</p>
  
  <p>I am able to instantiate the client like so:</p>
  
  <pre><code>import * as sendgrid from 'sendgrid';
  import Email = Sendgrid.Email;
  import Instance = Sendgrid.Instance;
  ...
  private client: Instance;
  ...
  this.client = sendgrid(user, key);
  </code></pre>
  
  <p>And then later in the code I am trying to send an email, which is why ts is forcing me to import the EMail interface in the first place.</p>
  
  <pre><code>var email = new Email();
  ...
  this.client.send(email, (err, data) =&gt; {
          if (err) {
              throw err;
          }
      });
  </code></pre>
  
  <p>tslint doesn't throw any error, but when I build and run the program (or just my tests), I get this: </p>
  
  <blockquote>
    <blockquote>
      <p>Mocha exploded!
      ReferenceError: Sendgrid is not defined
          at Object. (/Users/chrismatic/codingprojects/weview/weview-node/build/server/components/mail/clients/sendgrid.js:4:13)</p>
    </blockquote>
  </blockquote>
  
  <p>Has anybody a working implementation to showcase, or do I have to write my own interface? Thanks in advance for the help</p>
  
  <p>EDIT:</p>
  
  <p>The generated js file looks something like this:</p>
  
  <pre><code>var sendgrid = require('sendgrid');
  var Email = Sendgrid.Email;
  </code></pre>
  
  <p>If I decapitalize "Sendgrid", then the error disappears, but I can't do so in the ts file</p>