config:sensitive:set
Sets sensitive configuration values (those that should live in env.php, not config.php — API keys, payment credentials).
Synopsis
bin/magento config:sensitive:set [--scope=<scope>] [--scope-code=<code>] [--interactive] <path> <value>Arguments
- path
- Sensitive configuration path (e.g. payment/braintree/private_key)
- value
- Configuration value
Options
- --scope
- Scope: default, websites, stores
- --scope-code
- Scope code (website code or store code)
- --interactive
- Run command in interactive mode
Examples
Set a payment provider key — stored in env.php, not config.php.
bin/magento config:sensitive:set payment/braintree/private_key your-key-hereSee also
Related commands in config
Other config:* commands you might want next.
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.