How to pass variables from jupyterhub to jupyterlab


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?

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?

1 Like