This topic explains how to set up the Relay Proxy’s automatic configuration feature.
Relay Proxy automatic configuration is only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
With automatic configuration, the Relay Proxy automatically detects and supports new connections to updated or new environments whenever changes occur that impact LaunchDarkly SDK keys, mobile keys, or client-side IDs.
In a standard Relay Proxy, without automatic configuration, whenever you add or make changes to environments and projects in LaunchDarkly, you must manually update configuration files and restart the Relay Proxy to reflect the changes.
With automatic configuration enabled, you no longer need to manually update the Relay Proxy’s configuration files after you make configuration changes, nor do you need to restart the Relay Proxy for changes to take effect.
Additionally, you can use a page in the LaunchDarkly user interface (UI) to configure your Relay Proxy with the automatic configuration feature. A standard Relay Proxy requires all environments to be defined individually, and you cannot configure it through the LaunchDarkly UI.
You can also use the REST API: Relay Proxy configurations
If you enable automatic configuration, your Relay Proxy automatically detects and reacts to server-sent events including the following:
If you are using multiple SDK keys for your environment, any Relay Proxy using automatic configuration can only use the default SDK key.
This prevents you from needing to restart your Relay Proxy instances and potentially cause downtime while applying changes. These changes have no impact on your Relay Proxy’s performance.
With automatic configuration enabled, you only need to restart the Relay Proxy to upgrade it.
To enable automatic configuration, you must have a role that allows the createRelayAutoConfiguration action. The LaunchDarkly Admin and Architect organization roles, as well as the Admin and Owner base roles, include this ability. To learn more, read Relay Proxy configuration actions.
Enabling automatic configuration is a two-step process. These steps appear in detail below.
You must:
When you create a new Relay Proxy configuration, LaunchDarkly assigns a unique key to it. You must save the key immediately after you create the Relay Proxy configuration, because the key is only viewable on creation.
Here’s how to create a Relay Proxy configuration in the LaunchDarkly UI:

Next you must specify the key in a Relay Proxy configuration file so it includes the configuration you created. Here’s how:
If you configured the Relay Proxy with a configuration file, specify the Relay Proxy key in an AutoConfig section as the key property.
If you configured the Relay Proxy with environment variables, specify the Relay Proxy key with the AUTO_CONFIG_KEY environment variable. Here’s how:
From now on, the Relay Proxy will respond automatically to the project and environment state changes you specified.
You can use an inline policy to specify precise instructions on what environments and projects the Relay Proxy should include or exclude. An inline policy is similar to a role, but is created as part of the Relay Proxy configuration.
There are two ways to write an inline policy:
Each of these methods is described below.
You can create most policies using the policy builder.
To use the policy builder from the “Create a Relay Proxy configuration” panel:
This example gives the Relay Proxy access to all environments within the developerProjectKey project:

To learn more about using the policy builder, read Create policies for roles.
To write more complicated policies you can use the advanced editor. To learn how to write advanced policies, read About policies.
To use the advanced editor from the “Create a Relay Proxy configuration” panel:

You can limit the environments to include in an automatic Relay Proxy configuration. Expand each section below to view custom role policy examples.
Use this policy to give the Relay Proxy access to the production environment in all projects:
Use this policy to give the Relay Proxy access to the production environment in the “Mobile” project:
Use this policy to give the Relay Proxy access to all environments in projects starting with “Mobile-”:
Use this policy to give the Relay Proxy access production environments in projects tagged with “mobile”:
Use this policy to give the Relay Proxy access to non-production environments in projects not tagged with “federal”:
You can give members access to the Relay Proxy using the relay-proxy-config resource in a custom role policy. To learn more about Relay Proxy resource actions, read Relay Proxy configuration actions.
You can copy and paste this custom role policy into the advanced editor to grant access to all Relay Proxy actions:
To learn more about creating roles, read Roles.