Manual:Hooks/ResourceLoaderGetConfigVars

Details
ResourceLoaderStartUpModule::getConfig. Use this to export static configuration variables to JavaScript. Things that depend on the current page/request state must be added through MakeGlobalVariablesScript instead.
 * &$vars: Array of variables to be added into the output of the startup module.

Example
Here is an example of setting some configuration variables for Javascript from the hook:

Here is an example of retrieving the values on the Javascript side: