Branch-specific environment variable values from the Netlify UI, CLI, or API

We are excited to share that the “Scopes and Deploy Contexts for Environment Variables” beta in Labs has been updated to enable branch values from the Netlify UI, CLI, or API!

Some projects might require special configurations on long-lived branches, such as staging. In other cases, you might need to preview site updates that require a specific API token—before those changes land in production.

Developers can now set one environment variable key, with a different value on specific branches:

With this change, netlify.toml configuration or build plugins are no longer needed for branch values.

This beta update also enables you to manage variable scopes and contexts from the CLI or API. To learn more, visit the docs. You can enable the beta in Labs and begin migrating over sites from Site Settings. We always love to hear from you so please feel free to share any feedback you may have!