Skip to main content
When several of your sites use the same setting or API key, such as an ordering address or a service key, you can keep it once in an environment group and link the group to each site. Change it in the group, and every linked site gets the new value. This guide makes a group for Northwind’s café sites with one setting, links it to the Pearl District site, then removes it again.

Make a group

1

Open Environment groups

Click Settings at the bottom of the left rail, then Environment groups under Developer. Click New group.
2

Name it

Type a Name and click Create group. A name can use plain letters, digits, spaces, dots, dashes and underscores, so leave out accents such as the é in café.
New environment group, with the Name Cafe shared settings, outlined, and Create group, outlined

A new group

Add a setting to it

1

Click Add variable

The group opens. Click Add variable.
2

Fill it in

Type the Name in capital letters with underscores, such as ORDER_PICKUP_URL, and the Value. Under Tier, keep All tiers to use it on Development, Staging and Production, or pick one. Tick Sensitive for a secret such as an API key: its value is never shown again. Click Add variable.
Name ORDER_PICKUP_URL, Tier All tiers, Value https://order.example.com/northwind, and Add variable, each outlined

The setting and its value

The setting is listed under Variables, with its value hidden. The eye shows it, and the pencil changes it.
Cafe shared settings with the variable ORDER_PICKUP_URL, All tiers, its value hidden, outlined; Linked sites says no site uses this group yet

The group's variable

1

Open the site's Environment Variables

Open the website, click its name at the top of the page, then Settings. On the Environment Variables card, click Manage, and scroll to Environment groups.
2

Choose the group and click Link

Pick the group in the list and click Link.
Environment groups on the site: Cafe shared settings chosen in the list, outlined, and Link, outlined

Linking the group

The group is now listed with its variables, and a message says the site’s deployed functions have its variables. Link the same group to each site that needs it.
Cafe shared settings linked to the site with ORDER_PICKUP_URL and an Unlink button, outlined

Linked to the site

Good to know

  • A site’s own setting wins. If a site has its own variable with the same name, the site’s value is used instead of the group’s.
  • A change reaches every linked site. Saving a group updates the deployed functions of every site it is linked to, so check which sites are listed under Linked sites before you change a value.
  • Unlink or delete. Unlink on the site’s card stops that site using the group. Delete group, in the group’s menu, removes the group and its variables.
  • One site only? Use Store an API Key or Setting for Your Site instead. For every rule and limit, see Share Variables Across Sites.