Environment variables and secrets
Configure environment variables and secrets in your project, such as settings for your project or access tokens for APIs.
Currently CodeSandbox Projects only supports project-level configuration. The secrets and environment variables are shared across all VMs, but it's necessary to restart your workspace after making changes for them to take effect.
Environment variables are stored in our database, AES encrypted. The encryption key is rerolled from time to time on an unannounced schedule and the key is stored separately from the database.
Environment variables are enabled only for private repositories and they are only viewable by users with write access to the repository.
- Open your project in the Web Editor.
- Open the Menu through the icon in the top left corner.
- Click on the
- Add your configurations.
- From the Editor's menu, press
Restartto reload the workspace.
- From the Editor, open the command palette using ⌘ + K.
Add environment variables.
3. Add and your configurations.
- From the editor's menu, click to
You can review and change the existing environment variables and secrets by acessing them at any time throught the
Environment variables link at the Editor's menu. For any changes to take effect, don't forget to restart your workspace.