# How to set Environment variable in kibana

**URL:** <https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483>\
**Category:** Kibana\
**Created:** [June 9, 2021, 6:19pm UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483 "2021-06-09T18:19:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi\_yadav2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_yadav2/32/61530_2.png) [@ravi\_yadav2](https://discuss.elastic.co/u/ravi_yadav2)\
**Post date:** [June 9, 2021, 6:19pm UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483/1 "2021-06-09T18:19:12Z")

</div>

Hi Team,

I am working on 7.10.2 kibana source code. On kibana UI i want to show build version which is dynamic in nature and gets changed on each build . How i can access environment variable inside header.tsx file. How to set this environment variable having build version.

Please help team

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [June 9, 2021, 7:19pm UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483/2 "2021-06-09T19:19:08Z")

</div>

Hello Ravi,

It's possible to get environment info, but you'll have to do some work to pass that info where you want. [Here's an example](https://github.com/elastic/kibana/blob/4e0c889b309d34576366560c63c2a5ba3445db91/x-pack/plugins/maps/public/plugin.ts#L131) where the maps app is grabbing the Kibana version number and making it available for the rest of the app.

Regards,  
Aaron

---

<div class="post-metadata">

**Author:** ![ravi\_yadav2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_yadav2/32/61530_2.png) [@ravi\_yadav2](https://discuss.elastic.co/u/ravi_yadav2)\
**Post date:** [June 10, 2021, 6:23am UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483/3 "2021-06-10T06:23:29Z")

</div>

@Aaron_Caldwell Is there anything i can do to achieve it without manipulating x-pack folder?

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [June 10, 2021, 2:00pm UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483/4 "2021-06-10T14:00:51Z")

</div>

@ravi_yadav2 This example isn't specific to x-pack, it would work equally well in any plugin x-pack or not. Basically I'm just trying to show that you can access `env` variables from the `initialializerContext` which in this case is bound [here](https://github.com/elastic/kibana/blob/4e0c889b309d34576366560c63c2a5ba3445db91/x-pack/plugins/maps/public/plugin.ts#L122). You should be able to do this in any plugin.

---

<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:** [July 8, 2021, 2:01pm UTC](https://discuss.elastic.co/t/how-to-set-environment-variable-in-kibana/275483/5 "2021-07-08T14:01:38Z")

</div>

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