# Environment variables You can provide environment variables to your app. The environment variables can be added into the app that you publish in two ways. ## Add in your code You can pass the environment variables into your code as constants. Like simply adding a file on the workspace with the environment variables and accessing them through your code. If your environment variables have sensitive information, we do not recommend this approach as it would be hard coded into your code. And every time the environment changes, you will have to manually make the change and publish your new build. ## Add on the fly You can also add the environment variables from the [Chatlayer platform](https://app.chatlayer.ai). The environment variables set from there are dynamic which means that you can update them on the fly, and it does not require new builds and publishes. This makes your life a lot easier. The environment variables in [Chatlayer](https://app.chatlayer.ai) can be added as key value pairs and can be accessed from your app with the `bundle` object provided. ```javascript const YOUR_VARIABLE_NAME = bundle.env.YOUR_VARIABLE_NAME ``` To set up the environment variables into your app, follow the following steps: 1. Go to [Chatlayer](https://app.chatlayer.ai) 2. Login with your credentials 3. Select App Integrations from the left menu ![app_integrations_page.png](/assets/app_integrations_page.d39c33841a09f1126f51896a660cda73d35cbbe33bb672ee7bed100596239e5e.c88c3b11.png) 4. Select the app on which you want to provide the environment variable for ![Screenshot 2022.02.02 at 13.15.06.png](/assets/app_integration_detail.11b6905559ab5aae9020366f4f96639a8497867ca61a81330b275d0c5c00b52f.c88c3b11.png) 5. Select Environment Variables 6. Add the key value pairs for your environment - key is the name of the variable - value is the actual value of the variable ![Screenshot 2022.02.02 at 13.16.24.png](/assets/app_integration_detail_variables.6f654a5cf484b3d6008f3034917f72da47f0c297825dd5c4b9e1789d69e906ae.c88c3b11.png) If you want to access the environment variable defined above in your app, you can access it with ```javascript const authKey = bundle.env.OAUTH2_KEY; ``` If you want to change it on the fly, you can do it simply by updating the value from the chatlayer platform.