# How to fetch environment varibles in kibana plugin

**URL:** <https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431>\
**Category:** Kibana\
**Created:** [November 29, 2021, 11:52am UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431 "2021-11-29T11:52:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashant1](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@prashant1](https://discuss.elastic.co/u/prashant1)\
**Post date:** [November 29, 2021, 11:52am UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431/1 "2021-11-29T11:52:06Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [November 29, 2021, 6:42pm UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431/2 "2021-11-29T18:42:49Z")

</div>

How are you running Kibana, what is the value of environment variable TEST\_VALUE?

[Here is an example](https://github.com/elastic/kibana/blob/main/src/plugins/expression_error/public/components/error/show_debugging.tsx#L17) of where an environment variable is being used in Kibana.

---

<div class="post-metadata">

**Author:** ![prashant1](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@prashant1](https://discuss.elastic.co/u/prashant1)\
**Post date:** [November 30, 2021, 5:24am UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431/3 "2021-11-30T05:24:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prashant1](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@prashant1](https://discuss.elastic.co/u/prashant1)\
**Post date:** [December 1, 2021, 10:51am UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431/4 "2021-12-01T10:51:12Z")

</div>

any updates on this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 29, 2021, 10:51am UTC](https://discuss.elastic.co/t/how-to-fetch-environment-varibles-in-kibana-plugin/290431/5 "2021-12-29T10:51:40Z")

</div>

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