Environment variables and secrets
You can configure environment variables and secrets in your project, such as settings for your project or access tokens for APIs.
Currently, CodeSandbox Repositories only support project-level configuration. The secrets and environment variables are shared across all VMs, but you need 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 it 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 in the Editor's menu. Don't forget to restart your workspace so that any changes take effect.