code: function stormpathUserAgentMiddleware(req, res, next) {
      var newUserAgent = userAgent;
      var config = req.app.get('stormpathConfig');
      var stormpathAgent = req.headers['x-stormpath-agent'];
  
      if (stormpathAgent) {
        newUserAgent = stormpathAgent + ' ' + userAgent;
      }
  
      config.userAgent = newUserAgent;
  
      next();
    }
docs: Handle the X-Stormpath-Agent header. Important: This might not report 100% accurately since the user agent might be overwritten by a subsequent request with a different header (race condition). But this is "good enough" for now until we've solved this issue in the Node SDK (since creating new clients for each request is too expensive it would be better if we could just scope it).