docs: function initClient(app, opts) {
    opts.userAgent = userAgent;
  
    var logger = opts.logger;
  
    if (!logger) {
      logger = new winston.Logger({
        transports: [
          new winston.transports.Console({
            colorize: true,
            level: opts.debug || 'error'
          })
        ]
      });
    }
  
    app.set('stormpathLogger', logger);
  
    var client = require('./client')(opts);
  
    client.on('error', function (err) {
      logger.error(err);
      app.emit('stormpath.error', err);
    });
  
    client.on('ready', function () {
      app.set('stormpathClient', client);
      app.set('stormpathConfig', client.config);
    });
  
    return client;
  }