# How to pass variables from jupyterhub to jupyterlab

**URL:** https://discourse.jupyter.org/t/how-to-pass-variables-from-jupyterhub-to-jupyterlab/8674
**Category:** JupyterHub
**Tags:** how-to
**Created:** [April 7, 2021, 5:01pm UTC](https://discourse.jupyter.org/t/how-to-pass-variables-from-jupyterhub-to-jupyterlab/8674 "2021-04-07T17:01:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jian\_Zhang](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jian_zhang/32/3994_2.png) [@Jian\_Zhang](https://discourse.jupyter.org/u/Jian_Zhang)
#### Post date: [April 7, 2021, 5:01pm UTC](https://discourse.jupyter.org/t/how-to-pass-variables-from-jupyterhub-to-jupyterlab/8674/1 "2021-04-07T17:01:15Z")

</div>

Hi,

I setup my jupyterhub to start jupyterlab, if I wanna pass some variables from jupyterhub to jupyterlab, is there any way to achieve this other than setEnv() in jupyterhub?

---

<div class="post-metadata">

### Author: ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)
#### Post date: [April 7, 2021, 5:04pm UTC](https://discourse.jupyter.org/t/how-to-pass-variables-from-jupyterhub-to-jupyterlab/8674/2 "2021-04-07T17:04:49Z")

</div>

There are two main ways to pass environment variables from JupyterHub to JupyterLab:

- c.Spawner.environment is a dictionary of environment variables (name and value) to set explicitly for the JupyterLab process.
- c.Spawner.env\_keep is a list of environment variable names that should be passed on to the JupyterLab process, if they are defined for the Hub process.

Maybe env\_keep is what you are after?
