lib/intercom.io.js
function Intercom(appId, apiKey, options) {
  // Overload the contractor
  // Parse out single option objects
  if (_.isObject(appId) && !_.isString(appId) && ((appId.apiKey && appId.appId) || appId.personalAccessToken)) {
    apiKey = appId.apiKey || '';
    options = _.omit(appId, 'apiKey', 'appId');
    appId = appId.appId || appId.personalAccessToken;
  }

  // Preform some sane validation checks and throw errors
  // We need the appId
  if (!appId) {
    throw new IntercomError('Invalid App ID: ' + appId);
  }

  // Copy over the relavant data
  this.appId = appId;
  this.apiKey = apiKey || '';

  // Extend the defaults
  this.options = _.defaults(options || {}, Intercom.defaultOptions);

  // Contruct the endpoint with the correct auth from the appId and apiKey
  this.endpoint = this.options.endpoint;
}
function Intercom(appId, apiKey, options) {
  // Overload the contractor
  // Parse out single option objects
  if (_.isObject(appId) && !_.isString(appId) && ((appId.apiKey && appId.appId) || appId.personalAccessToken)) {
    apiKey = appId.apiKey || '';
    options = _.omit(appId, 'apiKey', 'appId');
    appId = appId.appId || appId.personalAccessToken;
  }

  // Preform some sane validation checks and throw errors
  // We need the appId
  if (!appId) {
    throw new IntercomError('Invalid App ID: ' + appId);
  }

  // Copy over the relavant data
  this.appId = appId;
  this.apiKey = apiKey || '';

  // Extend the defaults
  this.options = _.defaults(options || {}, Intercom.defaultOptions);

  // Contruct the endpoint with the correct auth from the appId and apiKey
  this.endpoint = this.options.endpoint;
}
function Intercom ( appId , apiKey , options ) { // Overload the contractor // Parse out single option objects if ( _ . isObject ( appId ) && ! _ . isString ( appId ) && ( ( appId . apiKey && appId . appId ) || appId . personalAccessToken ) ) { apiKey = appId . apiKey || '' ; options = _ . omit ( appId , 'apiKey' , 'appId' ) ; appId = appId . appId || appId . personalAccessToken ; } // Preform some sane validation checks and throw errors // We need the appId if ( ! appId ) { throw new IntercomError ( 'Invalid App ID: ' + appId ) ; } // Copy over the relavant data this . appId = appId ; this . apiKey = apiKey || '' ; // Extend the defaults this . options = _ . defaults ( options || { } , Intercom . defaultOptions ) ; // Contruct the endpoint with the correct auth from the appId and apiKey this . endpoint = this . options . endpoint ; }
`Intercom` constructor.

@param {String} appId - your app Id OR personalAccessToken
@param {String} apiKey - your api key
@param {Object} options - an options object
@api public
Intercom constructor .