Any demo about replaceInjectedVars?

I found a snippet in function getKibanaPayload:

      vars: await reduceAsync(
        uiExports.injectedVarsReplacers,
        async (acc, replacer) => await replacer(acc, request, server),
        defaults(await app.getInjectedVars() || {}, uiExports.defaultInjectedVars)
      )

I have no idea about:

        uiExports.injectedVarsReplacers,
        async (acc, replacer) => await replacer(acc, request, server),

any introduce about injectedVarsReplacers? and what's this ``` async (acc, replacer) => await replacer(acc, request, server)

Hi @whoami,

replaceInjectedVars is a property you can define in the UIExports in your plugin definition. It allows your plugin to make variables available to every application. You can read a bit more about it in the PR description that added the functionality: https://github.com/elastic/kibana/pull/9071

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.