Newer Version Available

This content describes an older version of this product. View Latest

Scratch Org Settings

In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs. Settings provide you with fine-grained control because you can define values for all fields for a setting, rather than just enabling or disabling it.

For information on Metadata API settings and their supported fields, see Settings in Metadata API Developer Guide.

Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.

Important

1{
2  "orgName": "Acme",
3  "edition": "Enterprise",
4  "features": ["Communities", "ServiceCloud", "Chatbot"],
5  "settings": {
6      "communitiesSettings": {
7          "enableNetworksEnabled": true
8      },
9      "lightningExperienceSettings": {
10          "enableS1DesktopEnabled": true
11      },
12      "mobileSettings": {
13          "enableS1EncryptedStoragePref2": true
14      },
15      "omniChannelSettings": {
16          "enableOmniChannel": true
17      },
18      "caseSettings": {
19          "systemUserEmail": "support@acme.com"
20      }
21  }
22}

Here’s an example of how to configure SecuritySettings in your scratch org. In this case, to define session timeout, you nest the field values.

1{
2  "orgName": "Acme",
3  "edition": "Enterprise",
4  "features": [],
5  "settings": {
6       "mobileSettings": {
7          "enableS1EncryptedStoragePref2": true
8       },
9      "securitySettings": {
10          "sessionSettings":{
11             "sessionTimeout": "TwelveHours"
12          }  
13      }
14  }
15}

Here’s an example of how to configure the IoT feature in your scratch org. It requires a combination of indicating the IoT feature and IoT scratch org settings.

1{
2  "orgName": "Acme",
3  "edition": "Enterprise",
4  "features": [],
5  "settings": {
6      "mobileSettings": {
7          "enableS1EncryptedStoragePref2": true
8       },
9      "iotSettings": {
10          "enableIoT": true,
11          "iotInsights": true
12      }
13  }
14}