The DigitalExperienceBundle metadata type represents a workspace in Enhanced LWR Experience Cloud sites, Salesforce CMS, or Marketing Cloud on Core. Introduced in API version 56.0, DigitalExperienceBundle stores every page view (sfdc_cms__view), route (sfdc_cms__route), theme (sfdc_cms__theme), branding set (sfdc_cms__brandingSet), and CMS asset as a modular content item backed by _meta.json and content.json files.

SFDX Four-Level Directory Structure

When retrieved into a Salesforce DX project, DigitalExperienceBundle organizes workspaces under force-app/main/default/digitalExperiences/<workspace_type>/<Workspace_Name>/:

Text
force-app/main/default/digitalExperiences/
└── site/
    └── Partner_Commerce_LWR1/
        ├── Partner_Commerce_LWR1.digitalExperience-meta.xml
        ├── sfdc_cms__appPage/
        │   └── mainAppPage/
        │       ├── _meta.json
        │       └── content.json
        ├── sfdc_cms__brandingSet/
        ├── sfdc_cms__route/
        │   └── Home/
        │       ├── _meta.json
        │       └── content.json
        ├── sfdc_cms__site/
        └── sfdc_cms__view/
            └── home/
                ├── _meta.json
                ├── content.json
                └── fr.json
digitalExperiences/ Workspace Type:site/ | marketing/ | general/ Workspace Folder(Partner_Commerce_LWR1.digitalExperience-meta.xml) Content Type Folders:- sfdc_cms__view- sfdc_cms__route- sfdc_cms__theme- sfdc_cms__brandingSet Content Item Folder:- _meta.json (apiName, type, parent, path)- content.json (Component Tree)- <lang>.json (Translations)

Key Properties in _meta.json

Every content item subfolder contains a _meta.json descriptor with four fields:

Property Type Required Description
apiName string Yes Unique alphanumeric/underscore identifier within that content type in the workspace
type string Yes Content type prefixed with sfdc_cms__ (for example, sfdc_cms__view, sfdc_cms__route)
parent string No Developer name of the parent content item (for example, linking a view to its route)
path string No Relative folder path within the workspace ("" for root items like sfdc_cms__site)

Production-Grade Examples

1. Workspace Header (Partner_Commerce_LWR1.digitalExperience-meta.xml)

XML
<?xml version="1.0" encoding="UTF-8"?>
<DigitalExperienceBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <description>Enhanced LWR Partner Commerce and Deal Registration portal.</description>
    <label>Partner Commerce LWR</label>
</DigitalExperienceBundle>

2. Content Item Metadata (sfdc_cms__view/home/_meta.json)

JSON
{
  "apiName": "home",
  "type": "sfdc_cms__view",
  "path": "views"
}

3. Retrieving and Deploying via package.xml

When deploying an Enhanced LWR site, include DigitalExperienceBundle, DigitalExperienceConfig, Network, and CustomSite:

XML
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>site/Partner_Commerce_LWR1</members>
        <name>DigitalExperienceBundle</name>
    </types>
    <types>
        <members>Partner_Commerce_LWR1</members>
        <name>DigitalExperienceConfig</name>
    </types>
    <types>
        <members>Partner Commerce LWR</members>
        <name>Network</name>
    </types>
    <types>
        <members>Partner_Commerce_LWR</members>
        <name>CustomSite</name>
    </types>
    <version>68.0</version>
</Package>

Warning

Keep <label> Synchronized with Network: For Enhanced LWR sites (site/<WorkspaceName>), the <label> in .digitalExperience-meta.xml must stay synchronized with the site’s Network name, and any translated <locale>.json files present in the target org must also be retrieved into your source branch before deploying.

Frequently asked questions

When do I use DigitalExperienceBundle instead of ExperienceBundle?

Use DigitalExperienceBundle for all Enhanced LWR sites (Build Your Own LWR and Microsites created on the enhanced CMS-backed platform in Winter '23 or later) as well as Salesforce CMS and Marketing workspaces. Use ExperienceBundle for Aura sites and legacy non-enhanced LWR sites.

What are the three supported workspace types under the digitalExperiences directory?

The three workspace type folders under force-app/main/default/digitalExperiences/ are site (for Enhanced LWR Experience Cloud sites), marketing (for Marketing Cloud workspaces), and general (for Salesforce CMS content workspaces).

What is the difference between content.json and _meta.json inside each content item folder?

The _meta.json file defines the content item's apiName, type (such as sfdc_cms__view or sfdc_cms__route), parent item, and folder path. The content.json file contains the actual component tree, properties, and title of the page or route.

Why does deploying a DigitalExperienceBundle fail if a target org has an extra translated language JSON file?

Before deploying a DigitalExperienceBundle, any translated variant JSON file that exists in the target org must also exist in the source bundle, otherwise the deployment fails validation.

How do I reference a DigitalExperienceBundle in package.xml?

Reference the bundle using the format workspace_type/workspace_name inside the members tag, such as site/Customer_Portal1 or marketing/Global_Campaigns.

Comments

Questions, corrections and tips are welcome. Comments are GitHub Discussions, so you sign in with GitHub.