Get Environment Variable inside Jupyter Extension

How may i fetch a environment variable inside a jupyter lab extension?

Assuming you want to access env variable in a client side extension -
In the extension I built, I actually make API call to Jupyter server to return certain config variables. Here’s how the call looks like on client side.

You can do a similar setup to fetch env variables.

Hello Amit, Thanks for help. I was looking for something related to kernel connector to run commands directly from the frontend. As i don’t want to create end points in API.
Found a similar solution