Newer Version Available

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

ExperienceBundle (Developer Preview)

Represents a text-based code structure of Community settings and site components, such as pages, branding sets, and themes. Developers can quickly update and deploy one or more Lightning communities programmatically using their preferred development tools.This type extends the Metadata metadata type and inherits its fullName field.
ExperienceBundle is available as a developer preview. ExperienceBundle isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don't implement functionality developed with these commands or tools.

File Suffix and Directory Location

ExperienceBundle components have the suffix .json and are stored in the experiences folder when retrieved. Each community in your org has its own folder. Each of these folders contains other folders for the supported properties.

The ExperienceBundle can contain one or more community definitions under the experiences folder. Each community definition has resource folders for brandingSets, config, routes, themes, and views each with additional, related configuration information in JSON files. Here’s an example community definition.

ExperienceBundle folder structure with example JSON file open.

Version

ExperienceBundle components are available in API version 46.0 and later.

This release contains a Developer Preview version of ExperienceBundle Metadata API that is production quality but has known limitations. To provide feedback and suggestions, go to IdeaExchange.

Note

Special Access Rules

While in Developer Preview, ExperienceBundle is available only in Developer Edition orgs. To access ExperienceBundle, select "Enable ExperienceBundle Metadata API" in the Community Management Settings section under Settings | Community Settings.

Fields

Field Name Field Type Description
experienceResources ExperienceResources The list of resources in this ExperienceBundle. Each resource represents an artifact of a community such as brandingSets, config, routes, themes, and views.
label string Required. Represents the name of the ExperienceBundle.
type SiteType Required. Identifies the kind of site. Only Lightning communities are supported, using the value ChatterNetworkPicasso.

ExperienceResources

Represents a list of communities in the bundle.

Field Name Field Type Description
experienceResource ExperienceResource The list of resources in this ExperienceBundle. Each resource represents a property for the community, such as brandingSets, config, routes, themes, and views.

ExperienceResource

Represents specific community information included in the ExperienceBundle.

Each type has a folder in the structure. Each folder contains one or more files providing information about that type and the site. Each corresponds to a specific folder and file in the ExperienceBundle.

Field Name Field Type Description
fileName string Required. Name of resource file.
format string Required. Only JSON is allowed.
source base64 The JSON content of each file.
type string Required. The type of the resource. Valid values are:
  • brandingSets
  • config
  • routes
  • themes
  • views

Folders and Bundled Definitions

Each ExperienceBundle includes five folders and associated data that is contained in JSON files.

brandingSets Folder

This folder contains one JSON file per brandingset, named brandingSets_name.json. Each file has the same structure and properties.

<brandingSets_name>.json

Property Type Description
definitionName string Required. Represents the name for the branding set that is used in grouping branding sets under a theme. Defined as theme:branding-theme.

For example, if the community theme is Stella, the definitionName would be stella:branding-stella.

In addition, there are several standard templates that have unique naming:
  • Customer Account Portal uses cpt:branding-cpt
  • Customer Service uses service:branding-service
  • Help Center uses helpCenter:branding-helpCenter
  • Partner Central uses prm:branding-prm
  • Build Your Own uses starter:branding-starter

The combination of definitionName + label must be unique in your org.

Note

id UUID Represents the component's GUID.
label string Represents the name of the branding set.

The combination of definitionName + label must be unique in your org.

Note

type string Represents the component type. The only supported value is brandingSet.
values map Required. Represents a map of branding values that can be applied to a community.
1{
2  "values" : {
3    "HeaderBackgroundColor" : "#FFFFFF",
4    "TextTransformStyle" : "none",
5    "BorderColor" : "#D4D4D4",
6    "DetailTextColor" : "#5A5A5A",
7    "HeaderFonts" : "Ek Mukta",
8    "CardBackgroundColor" : "rgba(255, 255, 255, 0)",
9    "LoginBackgroundColor" : "#F4F4F4",
10    "_ActionColorTrans" : "rgba(25, 124, 190, 0.9)",
11    "LoginBackgroundImage" : "../../../../sfsites/picasso/core/external/salesforceIdentity/images/background.jpg?v=1",
12    "PageBackgroundColor" : "#F5F7FA",
13    "_HeaderTextColor" : "rgba(34,34,34,.8)",
14    "_NavigationMenuHoverColor" : "rgba(255,255,255,.2)",
15    "_HeaderInputBackgroundColor" : "rgba(255,255,255,.4)",
16    "TextColor" : "#222222",
17    "NavigationMenuTextColor" : "#222222",
18    "_HeaderPlaceholderTextColor" : "rgba(85,85,85,.8)",
19    "_OverlayTextColorShadow" : "#000000",
20    "ActionColor" : "#0099DE",
21    "CompanyLogo" : "",
22    "_LinkColorDarker" : "#135F90",
23    "_ActionColorDarker" : "#135F90",
24    "_HoverColor" : "rgba(25, 124, 190, 0.05)",
25    "ErrorFontColor" : "#ff9e9e",
26    "OverlayTextColor" : "#FFFFFF",
27    "PrimaryFont" : "Ek Mukta",
28    "LinkColor" : "#3558D6"
29    },
30  "definitionName" : "cpt:branding-cpt",
31  "label" : "Customer Account Portal",
32  "id" : "283407c3-5938-4a6b-b97f-621cda6968c8",
33  "type" : "brandingSet"
34 }

config Folder

The config folder contains several JSON files.
  • sitename.json
  • languages.json
  • page_name.json

    One for each single-page application in the site: loginAppPage.json and mainAppPage.json

    Note

sitename.json File Properties

Property Type Description
forgotPasswordRouteId UUID Represents the ID of the route to use when a user forgets their password.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

isAvailableToGuests boolean Indicates whether public users have access to the site (true) or not (false). The default value is false.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

isFilteredComponentsView boolean Indicates whether the list of components is filtered based on the current page type (true) or not (false). Some components require specific parameters from the page and don't work unless you manually configure them. The default value is false.
isProgressiveRenderingEnabled boolean Indicates whether the display order of page components is prioritized (true) or not (false). The default value is false.
loginAppPageId UUID Represents the ID of the login page.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

mainAppPageId UUID Required. Represents the ID of the main page.
preferredDomainId string Represents the domain to use for indexing a community’s pages. Improves search engine results.
selfRegistrationRouteId UUID Represents the ID of the login route to use for self-registration.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

type string Represents the component type. The only supported value is site.
1{
2   "isAvailableToGuests" : false,
3   "isFilteredComponentsView" : false,
4   "mainAppPageId" : "df9907cb-6e68-4ca1-8bb2-51173ca5374e",
5   "loginAppPageId" : "58e9939a-84b2-498d-bbc5-7a89d89087fa",
6   "selfRegistrationRouteId" : "ad5c8bf1-297f-4ad3-b47c-0e35d85f10ef",
7   "forgotPasswordRouteId" : "e3139f6f-44d8-4eec-be9d-3609ce063039",
8   "isProgressiveRenderingEnabled" : false,
9   "preferredDomainId" : "none",
10   "type" : "site"
11}

languages.json File Properties

Property Type Description
defaultCode string Required. Represents the base language code plus the country code where used.
defaultLabel string Required. Defines the display label for the language.
id UUID Represents the component's GUID.
type string Represents the component type. The only supported value is languageContainer.

There is one section per supported language as a container in languages.json

language container

Property Type Description
countryCode string Represents the country code of the selected language. This string can be empty. It applies only when the selected language has variations depending on the country, like Arabic (Algeria) and Arabic (Bahrain). In this case, use countryCode to distinguish between them.

For example:{ languageCode" : "ar", "CountryCode" : "DZ", "Label" : "Arabic (Algeria) (DZ)",}, { "Code" : "ar", "CountryCode" : "BH", "Label" : "Arabic (Bahrain) (BH)",}

fallbackLanguageId UUID Represents the language to use when no content is available for the selected language. For example, imagine that a community visitor chooses Japanese from the language selector, but there is no content for that page in Japanese. Content is displayed in the fallback language.
id UUID Represents the component's GUID.
isActive boolean Indicates whether a language is available to community visitors in the language selector (true) or not (false). The default value is true.
label string Defines the display label for a language. The display label appears in any language selector components that you add to your community and in the language selector in Community Builder.
languageCode string Represents the language code for the selected language.
type string Represents the component type. The only supported value is language.
1{
2    "defaultCode" : "en_US",
3    "defaultLabel" : "English (US)",
4    "id" : "04597c83-0b9d-4f16-9f4d-4ec28bd553b4",
5    "type" : "languageContainer",
6    "languages" : [ {
7        "languageCode" : "af",
8        "countryCode" : "",
9        "isActive" : true,
10        "label" : "Afrikaans",
11        "fallbackLanguageId" : "c6e7fe67-55e0-47b3-ad58-bf49539249f0",
12        "id" : "22036d6f-11ce-4f7b-b7f0-f2c409f817ea",
13        "type" : "language"
14        }
15     ]
16 }
The page file represents single-page applications in the community. One file per page, named page_name.json.

Each Lightning community is actually a single-page application, which is a web app that loads a single HTML page. Single-page applications use multiple views to update the page dynamically as the user interacts with it.

Note

page_name.json File Properties

Property Type Description
cmsSettings map Settings for the CMS Connect header and footer. Allowed values:
  • headerName
  • headerUrl
  • headerPersonalization
  • footerName
  • footerUrl
  • footerPersonalization
Both source and target org must have the CMSConnect and CMSPersonalization org perms enabled for settings to be retrieved.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

currentThemeId UUID Required. Represents the UUID of the site's current theme. This field is available only for the site's main page.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

headMarkup string Required. Allows the addition of custom markup to the community's main page <head> tag. Similar to using Community Builder | Setting | Advanced | Head Markup See Salesforce Help for markup guidance.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

id UUID Required. Represents the component's GUID.
isRelaxedCSPLevel boolean Controls the ability to run scripts and script access to third-party hosts. The default is false.

Not supported if the active template for the community doesn't support login (such as Help Center).

Note

label string Required. Represents the name of the page.
templateName string Required. Represents the unique developer name of the template page. Allowed values are:
  • Help Center
  • Customer Account Portal
  • Community Template
  • Customer Service
  • Build Your Own
  • Partner Central
  • Custom template (name which was used during the template creation)
type string Required. Represents the component type. The only supported value is appPage.
1{
2    "headMarkup" : null,
3    "isRelaxedCSPLevel" : false,
4    "templateName" : "CPT Community Template",
5    "cmsSettings" : { },
6    "currentThemeId" : "ff52089c-6ad9-4dd9-b5b5-251d4a117ce3",
7    "label" : "main",
8    "id" : "df9907cb-6e68-4ca1-8bb2-51173ca5374e",
9    "type" : "appPage"
10}

routes Folder

The routes folder contains one JSON file per page, named <page_name>.json.

<page_name>.json

Property Type Description
appPageId UUID Required. Represents the Single Page Application (SPA) page for the route. It points to either main.json or login.json.
id UUID Required. Represents the component GUID. Inherited from the component.
label string Required. Represents the name of the route. Inherited from the component.
objectApiName string Required. The name of the custom object API. (Not available for standard objects.)
pageAccess string Required. Identifies the status of a route as public or private. When set to the default value UseParent, the status of the site determines the status of the route. Not editable from the user interface for routes that are always private. Valid values are UseParent, Public, and RequireLogin.
routeType string Required. Identifies the type of route. Value is unique among all routes that share the same RoutePage.
type string Required. Represents the component type. The only supported value is route.
urlPrefix string Required. Represents the base URL for the route.
1{
2    "urlPrefix" : "",
3    "appPageId" : "b5fe94e2-071f-47b2-b76d-427a624cb407",
4    "routeType" : "home",
5    "pageAccess" : "UseParent",
6    "label" : "Home",
7    "id" : "c7263124-7bc4-4147-a39a-25fe7e305b98",
8    "type" : "route"
9}

themes Folder

The themes folder contains one JSON file per theme named theme_name.json.

theme_name.json

Property Type Description
activeBrandingSetId UUID The id of the branding set currently in use. The branding set's definitionName must match the theme's brandingSetReference.
customCSS string Custom CSS for pages created from Lightning community template.
developerName string Required. The unique developer name of the theme. Most themes derive their names directly, for example Jepson uses jespon for its developerName.
Standard templates have unique values:
  • cpt for Customer Account Portal
  • service for Customer Service
  • helpCenter for Help Center
  • prm for Partner Central
  • starter for Build Your Own
id UUID Required. Represents the component's GUID.
label string Represents the name of the theme.
layouts map Required. Maps ThemeLayoutType to UUID, and contains the definition of the ThemeLayout. Login and Inner theme layouts are always required.
type string Required. Represents the component type. The only supported value is theme.
1{
2    "developerName" : "cpt",
3    "layouts" : {
4        "Login" : "12162c3e-06ac-43a9-adc7-db36ae5140b0",
5        "Inner" : "c09d58be-0622-4fc4-806a-ed34174929f9"
6    },
7    "customCSS" : "",
8    "activeBrandingSetId" : "283407c3-5938-4a6b-b97f-621cda6968c8",
9    "label" : "Customer Account Portal",
10    "id" : "ff52089c-6ad9-4dd9-b5b5-251d4a117ce3",
11    "type" : "theme",
12    "views" : [ {
13        "componentName" : "salesforceIdentity:loginBody2",
14        "label" : "Login",
15        "id" : "12162c3e-06ac-43a9-adc7-db36ae5140b0",
16        "type" : "view",
17        "regions" : [ {
18            "regionName" : "header",
19            "id" : "f8354922-11f2-495d-9d89-0a51943af2b0",
20            "type" : "region",
21            "components" : [ ]
22        } ]
23    } ]
24}

Views can be children of a theme. These children are structured the same as views in the views folder.

Note

views Folder

The views folder contains several JSON files that each define a view. Each Lightning community is built from single-page applications, which are web apps that load a single HTML page. Single-page applications consist of multiple views that update the page dynamically as the user interacts with it.

A view is made up of regions that contain other regions or components in the rendered page for the user. Within the views folder there is one file per view, named view_name.json.

Single-page applications in your community are defined in the page files of the config folder.

Note

view_name.json

Property Type Description
appPageId UUID Required. Single Page Application (SPA) page ID of the view. It points to either main.json or login.json.
componentName string Required. The FQN of the layout component. The component must implement forceCommunity:layout or, for theme layouts, forceCommunity:themeLayout
id UUID Required. Represents the GUID of the component.
label string Required. The name that appears in Community Builder | Settings | Theme | Configure.
themeLayoutType string Theme layout type of the view (exposed only for views).
type string Required. Represents the type of the component. The only supported value is view.
viewType string Required. Matches routeType for the route.

There are one or more regions as a container in each <view_name>.json

region container

Property Type Description
id UUID Required. Represents the component GUID.
regionLabel string Specifies region labels for tabs.

This property is present only for tab regions that are children of a component.

Note

regionName string Required. Matches the design attribute in the design file of the layout component.
type string Required. Represents the component type. The only supported value is region.

There are one or more components as a container in the region section of each <view_name>.json

component container

Property Type Description
componentAttributes HashMap Required. The design attribute values of the component.
componentName string Required. The FQN of the component. Only components that can be used in the component panel in Community Builder can be used in this field.
id UUID Required. Represents the component GUID.
renderPriority enums.priority Sets priority value for progressive rendering of the component. Possible Values: HIGHEST, HIGH, NEUTRAL

Only evaluated if the community has progressive rendering turned on in Community Builder | Settings | Advanced.

Note

renditionMap HashMap Map of different rendition keys to UUIDs of RenditionComponents.
type string Required. Represents the component type. The only supported value is component.

Each component can have a rendition container in each <view_name>.json

rendition container

Property Type Description
id UUID Required. Represents the component GUID.
renditionValue map Map of different variations of a component, such as different languages of text.
type string Required. Represents the component type. The only supported value is renditionComponent.
1{
2    "themeLayoutType" : "Inner",
3    "viewType" : "account-management",
4    "appPageId" : "df9907cb-6e68-4ca1-8bb2-51173ca5374e",
5    "componentName" : "siteforce:sldsOneColLayout",
6    "label" : "Account Management",
7    "id" : "9ca8fa47-8e87-4915-a6f7-c2d8d37f3076",
8    "type" : "view",
9    "regions" : [ {
10         "regionName" : "content",
11         "id" : "969ada98-7d72-4e45-8a10-7db51fae247c",
12         "type" : "region",
13         "components" : [ {
14            "componentName" : "forceCommunity:tabset",
15            "componentAttributes" : {
16                "tabsetConfig" : "{\"UUID\":\"4711850e-ffdc-4375-a45e-f716bcdbbb1c\",\"activeTab\":\"tab1\",\"useOverflowMenu\":false,\"tabs\":[{\"UUID\":\"bc8fb51f-4783-43d4-9376-60c07677a367\",\"tabName\":\"Members\",\"tabKey\":\"tab1\",\"locked\":false,\"allowGuestUser\":false,\"seedComponents\":[{\"fqn\":\"forceCommunity:relatedList\",\"attributes\":{\"parentRecordId\":\"{!CurrentUser.accountId}\",\"relatedListName\":\"Users\",\"customTitle\":\"Members\",\"showCustomTitle\":\"true\",\"showBreadCrumbs\":\"false\",\"showRowNumbers\":\"false\",\"showManualRefreshButton\":\"false\"}}]},{\"UUID\":\"f2793a99-b757-4be4-846f-dc98a13a8139\",\"tabName\":\"Branding\",\"tabKey\":\"tab2\",\"locked\":false,\"allowGuestUser\":false,\"seedComponents\":[{\"fqn\":\"forceCommunity:accountBrandRecord\",\"attributes\":{\"recordId\":\"{!CurrentUser.accountId}\"}}]}]}",
17                "regions" : ""
18            },
19            "renderPriority" : "NEUTRAL",
20            "renditionMap" : { },
21            "id" : "4711850e-ffdc-4375-a45e-f716bcdbbb1c",
22            "type" : "component",
23            "renditions" : [ {
24               "renditionValue" : {
25                  "LumenInstanceAttributes" : {
26                  "richTextValue" : "<p>new text</p>"
27                  }
28               },
29              "id" : "9d8878df-f520-4010-861c-57b930a3daab",
30              "type" : "renditionComponent"
31            } ]
32        } ]
33    } ]
34}

Declarative Metadata Sample Definition

Here’s an example of an ExperienceBundle declaration. For individual folder and file examples for the bundled code, see brandingSets, config, routes, themes, and views.

1<xsd:complexType name="ExperienceBundle">
2    <xsd:complexContent>
3        <xsd:extension base="tns:Metadata">
4            <xsd:sequence>
5                <xsd:element name="experienceResources" minOccurs="0" type="tns:ExperienceResources"/>
6                <xsd:element name="label" type="xsd:string"/>
7                <xsd:element name="type" type="tns:SiteType"/>
8            </xsd:sequence>
9        </xsd:extension>
10    </xsd:complexContent>
11</xsd:complexType>
12    <xsd:complexType name="ExperienceResources">
13        <xsd:sequence>
14            <xsd:element name="experienceResource" minOccurs="0" maxOccurs="unbounded" type="tns:ExperienceResource"/>
15        </xsd:sequence>
16    </xsd:complexType>
17<xsd:complexType name="ExperienceResource">
18    <xsd:sequence>
19        <xsd:element name="fileName" type="xsd:string"/>
20        <xsd:element name="format" type="xsd:string"/>
21        <xsd:element name="source" minOccurs="0" type="xsd:base64Binary"/>
22        <xsd:element name="type" type="xsd:string"/>
23    </xsd:sequence>
24</xsd:complexType>

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.