I need to access my spec/config_data in the JavaScript middleware. I’m using the following:
var authenticate = new TykJS.TykMiddleware.NewMiddleware({});
authenticate.NewProcessRequest(function(request, session, spec) {
…
}
This is according to documentation at
https://tyk.io/docs/customise-tyk/plugins/javascript-middleware/middleware-scripting-guide/
However, the spec object that is supposed to be sent is always undefined. I’ve verified its loaded in the API definition correctly and can view the data in the dashboard. What gives? The documentation says I should expect that data in the spec…