lib/client.js
function Client(appId, options) {
  this.appId = appId;
  this.stubbed = false;
  this.userAgent = defaultUserAgent;
  this._validator = new Validator();

  // NOTE: We need to add a listener to the "error" event so the users aren't
  //       forced to set up a listener themselves. If no listener for "error"
  //       exists, emitting the event results in an uncaught error.
  this.on("error", function() { });

  if (options) {
    for (var property in options) {
      if (!options.hasOwnProperty(property))
        continue;
      this[property] = options[property];
    }
  }
}
function Client(appId, options) {
  this.appId = appId;
  this.stubbed = false;
  this.userAgent = defaultUserAgent;
  this._validator = new Validator();

  // NOTE: We need to add a listener to the "error" event so the users aren't
  //       forced to set up a listener themselves. If no listener for "error"
  //       exists, emitting the event results in an uncaught error.
  this.on("error", function() { });

  if (options) {
    for (var property in options) {
      if (!options.hasOwnProperty(property))
        continue;
      this[property] = options[property];
    }
  }
}
function Client ( appId , options ) { this . appId = appId ; this . stubbed = false ; this . userAgent = defaultUserAgent ; this . _validator = new Validator ( ) ; // NOTE: We need to add a listener to the "error" event so the users aren't //       forced to set up a listener themselves. If no listener for "error" //       exists, emitting the event results in an uncaught error. this . on ( "error" , function ( ) { } ) ; if ( options ) { for ( var property in options ) { if ( ! options . hasOwnProperty ( property ) ) continue ; this [ property ] = options [ property ] ; } } }
Creates a new client for the Heap server-side API.

@constructor
@param {string} appId the Heap application ID from
https://heapanalytics.com/app/install
@param {Object} options defined below
@param {boolean} options.stubbed if true, this client makes no Heap API
calls
@param {string} options.userAgent the User-Agent header value used by this
Heap API client
@alias heap-api.Client
Creates a new client for the Heap server - side API .