code: function Client(opts) {
    var self = this;
    opts = opts || {};
  
    events.EventEmitter.call(this);
  
    this._endpoint = opts.oauth.instance_url + '/cometd/' + opts.apiVersion.substring(1);
    this._fayeClient = new faye.Client(this._endpoint, {
      timeout: opts.timeout,
      retry: opts.retry
    });
    this._fayeClient.setHeader('Authorization', 'Bearer ' + opts.oauth.access_token);
  
    this._fayeClient.on('transport:up', function() {
      self.emit('connect');
    });
  
    this._fayeClient.on('transport:down', function() {
      self.emit('disconnect');
    });
  
    this._replayFromMap = {};
  
    var client = this;
    var replayExtension = {
      outgoing: function(message, callback) {
        if (message.channel === '/meta/subscribe') {
          if (!message.ext) { message.ext = {}; }
          message.ext['replay'] = client._replayFromMap;
        }
        callback(message);
      }
    };
    this._fayeClient.addExtension(replayExtension);
  }
docs: Client definition