Requirements
To use this feature, you’ll need to install the beta version of the Go, JS, or Python SDK:Read environment variables
- Go
- JavaScript
- Python
To read environment variables stored in an Environment, use the The method returns a Each
GetVariables() method. Replace <your-environment-id> with the Environment’s ID.GetVariablesResponse struct that contains a list of the environment variables stored in the Environment.EnvironmentVariable struct in the response contains the following:- Name: The environment variable’s name (for example,
DB_HOST). - Value: The environment variable’s value.
- Masked: A boolean that indicates whether the value is hidden by default in the 1Password app.
1Password Environment variables are masked by default. To change this:
- Open and unlock the 1Password desktop app.
- Select Developer > View Environments.
- Choose the Environment, select Edit, then select the vertical ellipsis next to the variable and select Show value by default.
Appendix: Get an Environment’s ID
To read environment variables from a 1Password Environment, you’ll need its unique identifier (ID). You can find this ID in the 1Password desktop app:- Open and unlock the 1Password desktop app.
- Navigate to Developer > View Environments.
- Select View environment next to the Environment you want to fetch.
- Select Manage environment > Copy environment ID.