Yes, there is, and there is also a package for this use case called config, available at CRAN. A good place to start is at the pkgdown documentation site at Manage Environment Specific Configuration Values • config
The config package describes this, but in a nutshell: Your Connect server will set an environment variable called R_CONFIG_ACTIVE that you can read and respond to.
The config package gives you a way to set you default values in a single config.yml file, and then your code can respond differently, depending on the active configuration.