We have multiple rules and some of the rules use functions that is assigned to the global object. This is done in a rule running first in the “rule chain”, like so:
if (!global.foo) {
global.foo = function () { };
}
This used to be recommended approach according to the Auth0 rules documentation:
The legacy approach will continue to work for the time being (at least 6 months), though there currently is not a better alternative for rules at this time.
Not exactly - as we migrate the platform for Rules this approach may or may not work - we don’t know right now. However, in the new world for rules/hooks all npm modules should be available so that would be the preferred option.