title: How to access braintree functionality from Meteor server
body: <p>I'm trying to use Braintree in my Meteor application, and I've made a local package of <a href="https://github.com/ripplehq/meteor-braintree" rel="nofollow">this Braintree packaging</a>, following the instructions of <a href="https://dweldon.silvrback.com/local-packages" rel="nofollow">this blog post on the subject</a>, and the install went fine.</p>
  
  <p>Now though, I have this code:</p>
  
  <pre class="lang-js prettyprint-override"><code>// defined in server/fixtures.js
  Gateway = braintree.connect({
      environment: braintree.Environment.Sandbox,
      merchantId: "secret",
      publicKey: "secret",
      privateKey: "secret"
  });
  </code></pre>
  
  <p>and it's throwing this error:</p>
  
  <pre><code>ReferenceError: braintree is not defined
  (etc....)
  </code></pre>
  
  <p>I then tried throwing in this line as recommended by <a href="https://www.braintreepayments.com/docs/node/guide/getting_paid" rel="nofollow">the Braintree documentation</a>, but it simply throws an error that "require" isn't defined.</p>
  
  <pre><code>var braintree = require("braintree");
  </code></pre>
  
  <p>The Braintree docs uses Express methodologies to make everything happen, but that's not a lot of help here.</p>
  
  <p>The package I referenced earlier defines it's <code>server.js</code> with this single line:</p>
  
  <pre><code>Braintree = Npm.require("braintree");
  </code></pre>
  
  <p>so I tried changing my references to <code>Braintree</code> rather than <code>braintree</code>, but this was undefined the exact same way.</p>
  
  <p>How do I get at Braintree to use it? </p>
  
  <p>Thanks in advance!</p>