How to fetch environment varibles in kibana plugin

Hi

We are testing kibana plugin in 7.10.2.
When we tried to used process.env.TEST_VALUE in our code and run yarn build on kibana plugin and after unzip when we search for the TEST_VALUE we get it in the below format in testPlugin.chunk.1.js

Object({IS_KIBANA_DISTRIBUTABLE:"true"}).TEST_VALUE

and by using the above way the env is not updated in the code.

Could someone please help us How to map env variables from backend in the code?

Thanks

How are you running Kibana, what is the value of environment variable TEST_VALUE?

Here is an example of where an environment variable is being used in Kibana.

Hi @Nathan_Reese
Thanks for the quick response.

We are running kibana via docker and plugin we are generating in local env setup after creating the zip file. We are copying the content inside the pod at plugin path.
Basically TEST_VALUE contains a string text Which we are setting as env while deploying kibana as docker. Which we want to see on UI.
So we want to fetch the value of TEST_VALUE in the code so that it can be visualise on UI.

Our doubt is how to fetch any value of environment variables which is available inside kibana pod to the source code(plugin) so that it can be reflected on UI?

In the example given process.env.NODE_ENV === 'production' we are setting the value of production in the code itself. For our case we want to fetch the value from the envs available inside the kibana pod.

Thanks

any updates on this?

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