How to access kibana.yml parameters in Custom Kibana Plugin 7.10.0

Holla !

  • I am using 7.10.0 version of kibana and I need to access kibana.yml's parameters in custom Plugin (consisting backend and frontend).


constructor(initializerContext: PluginInitializerContext) {
    this.logger = initializerContext.logger.get();
    this.environmentConfig = initializerContext.env;

  public setup(core: CoreSetup<AividInsightsPluginStartDeps>, deps: AividInsightsPluginSetupDeps) {
    this.logger.debug('aividInsights: Setup');
    const router = core.http.createRouter();

    core.getStartServices().then(([_, depsStart]) => {
      // console.log(_, depsStart, this.environmentConfig);

      const serverConfigData = {
        esClient: _.elasticsearch.client,
        esHosts: _.elasticsearch.client.config.hosts,
        additionBasePath: _.http.basePath.get(),
        environmentConfig: this.environmentConfig,
              ?.slice(0, -6)
              .replace('http:', 'https:')}:32000`,
      registerRoutes(router,, this.logger, serverConfigData);

    return {};

I tried using the given parameters of plugins (intializerContext, core, deps) but I still have not found yml variables.
Is there any variable available that consists the parameters of yml.
I want to access server.ssl.enabled , server.ssl.certificate , server.ssl.key ,

Hi @Hackwithharshil and welcome to the community!

Kibana configuration is accessible through the initializerContext.config API.
You should also be able to access the configuration from the plugin that registers the settings if you add that plugin as a dependency to yours.

It's challenging to provide the exact code to suit your needs but a great place to start is to look at the examples given for how to use config in the Kibana platform.

You'll also find other examples in Kibana's code in the x-pack plugins folder.

I hope that helps!

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