generating-ui-bundle-site
forcedotcom/sf-skills
Create and configure Salesforce Digital Experience Sites to host React UI bundles.
What is generating-ui-bundle-site?
This skill generates the minimum site infrastructure needed to host a React UI bundle on Salesforce, including Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and content type metadata. Use it when you need to create or configure a Digital Experience Site for guest-accessible or authenticated React applications.
- Generates Network metadata for site networking configuration
- Creates CustomSite metadata for URL and access settings
- Produces DigitalExperienceConfig for site configuration
- Builds DigitalExperienceBundle structure linking to React UI bundles
- Generates sfdc_cms__site content type with metadata and content JSON
- Validates all five required properties before generating any files
How to install generating-ui-bundle-site
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-ui-bundle-site- Project must contain a uiBundles/*/src/ directory with a React UI bundle
- Access to target Salesforce org to query UIBundle metadata and Organization namespace
- sfdx-project.json file in the project root
How to use generating-ui-bundle-site
- 1.Resolve all five required properties: siteName, siteUrlPathPrefix, appNamespace, appDevName, and enableGuestAccess using the provided fallback chains
- 2.Read the full contents of all referenced docs files (configure-metadata-*.md) to understand templates
- 3.Create project directories and files following the specified paths for Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and DigitalExperience metadata
- 4.Substitute resolved property values into template placeholders (marked with {braces}) without modifying other default values
- 5.Run validation: sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org {usernameOrAlias}
Use cases
- Publishing a React app as a guest-accessible Salesforce site
- Setting up a Digital Experience Site to host an existing UI bundle
- Configuring site infrastructure with custom URL path prefixes and namespaces
- Creating authenticated or guest-access site configurations for React applications
- Updating site URLs and regenerating related metadata components
- Salesforce developers building React applications on Digital Experience Sites
- Teams deploying UI bundles to Salesforce orgs
- Developers configuring guest access for community or public-facing apps
generating-ui-bundle-site FAQ
Activate when your project contains uiBundles/*/src/ and you need to create or configure site infrastructure, or when files matching digitalExperiences/, networks/, customSite/, or DigitalExperienceBundle exist and need modification.
The site will deploy successfully but display a blank page because it cannot locate the correct React UI bundle. Always resolve these from real project data using the provided fallback chains.
No. React sites differ from standard LWR sites—they act as thin containers that delegate rendering to the React UI bundle. Only the five core metadata types are required.
Read the update-site-urls.md documentation to understand the three-component architecture, then follow the step-by-step workflow to update URLs consistently across DigitalExperienceConfig, Network, and CustomSite.
The default is false (authenticated access only). Ask the user whether unauthenticated guest users should access site APIs before proceeding.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: generating-ui-bundle-site description: "MUST activate when the project contains a uiBundles/*/src/ directory and the task involves creating or configuring site infrastructure. Use this skill when creating or configuring a Salesforce Digital Experience Site for hosting a UI bundle. Activate when files matching digitalExperiences/, networks/, customSite/, or DigitalExperienceBundle exist and need modification, or when the user wants to publish, host, or configure guest access for their app." metadata: version: "1.0"
Digital Experience Site for React UI Bundles
Create and configure Digital Experience Sites that host React UI bundles on Salesforce. This skill generates the minimum necessary site infrastructure — Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and the sfdc_cms__site content type — so a React app can be served from Salesforce.
React sites differ from standard LWR sites: they don't need routes, views, theme layouts, or branding sets. The site acts as a thin container (appContainer: true) that delegates rendering to the React UI bundle referenced by appSpace.
Required Properties
Resolve all five properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.
| Property | Format | How to Resolve |
|---|---|---|
| siteName | UpperCamelCase (e.g., MyCommunity) | Ask user or derive from context |
| siteUrlPathPrefix | All lowercase (e.g., mycommunity) | User-provided, or convert siteName to all lowercase with alphanumeric characters only |
| appNamespace | String | namespace in sfdx-project.json → sf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias} → default c |
| appDevName | String | UIBundle metadata in the project → sf data query -q "SELECT DeveloperName FROM UIBundle" --target-org ${usernameOrAlias} → default to siteName |
| enableGuestAccess | Boolean | Ask user whether unauthenticated guest users can access site APIs → default false |
The appNamespace and appDevName properties connect the site to the correct React application. Getting these wrong means the site deploys but shows a blank page, so take care to resolve them from real project data.
Generation Workflow
Step 1: Resolve All Required Properties
Determine values for all five properties before constructing anything. Use the resolution strategies in the table above, falling through each option until a value is found.
Step 2: Create the Project Structure
Use available Salesforce metadata schema and field context for Network, CustomSite, DigitalExperienceConfig, and DigitalExperienceBundle to ensure each file uses valid structure.
Create any files and directories that don't already exist, using these paths:
| Metadata Type | Path |
|---|---|
| Network | networks/{siteName}.network-meta.xml |
| CustomSite | sites/{siteName}.site-meta.xml |
| DigitalExperienceConfig | digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml |
| DigitalExperienceBundle | digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml |
| DigitalExperience (sfdc_cms__site) | digitalExperiences/site/{siteName}1/sfdc_cms__site/{siteName}1/* |
The DigitalExperience directory contains only _meta.json and content.json. Do not create any directories other than sfdc_cms__site inside the bundle.
Step 3: Populate All Metadata Fields
Use the default templates in the docs below. Values in {braces} are resolved property references — substitute them with the actual values from Step 1.
| Metadata Type | Template Reference |
|---|---|
| Network | configure-metadata-network.md |
| CustomSite | configure-metadata-custom-site.md |
| DigitalExperienceConfig | configure-metadata-digital-experience-config.md |
| DigitalExperienceBundle | configure-metadata-digital-experience-bundle.md |
| DigitalExperience (sfdc_cms__site) | configure-metadata-digital-experience.md |
For URL updates, see update-site-urls.md.
Execution Note for Step 3: Load and use the docs
- Agents MUST read the full contents of each docs/*.md file referenced in Step 3 before attempting to populate metadata fields.
- Use your platform's file-read tool (for example,
read_file) to load these files in full, then perform placeholder substitution for values in{braces}using the resolved properties from Step 1. - Files to load:
docs/configure-metadata-network.mddocs/configure-metadata-custom-site.mddocs/configure-metadata-digital-experience-config.mddocs/configure-metadata-digital-experience-bundle.mddocs/configure-metadata-digital-experience.md
- Read entire file contents, replace placeholders (e.g.
{siteName}) with the resolved values, then use the expanded templates to populate the metadata XML/JSON content.
Step 4: Do Not Modify Non-Templated Properties
Do not modify any default property values for Network, CustomSite, DigitalExperience, DigitalExperienceConfig, or DigitalExperienceBundle metadata that are not expressed as variables wrapped in {braces}.
Verification Checklist
Before deploying, confirm:
- All five required properties are resolved
- All metadata directories and files exist per the project structure
- All metadata fields match the Step 3 templates with
{braces}substituted only; no other default property values were added or changed -
appSpaceincontent.jsonmatches an existingUIBundlemetadata record - Deployment validates successfully:
sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias}
Common Workflows
Updating Experience Site URLs
Use when user wants to update or change site URLs (urlPathPrefix).
Steps:
- Read update-site-urls.md to understand the three-component architecture and URL update workflow
- Follow the step-by-step workflow in the doc to update URLs consistently across all three components (DigitalExperienceConfig, Network, CustomSite)
Related skills
More from forcedotcom/sf-skills and the wider catalog.

generating-validation-rule
Create and manage Salesforce Validation Rules to enforce data quality and business logic at the data layer.

generating-visual-diagrams
AI-powered rendered image generation for Salesforce visuals: ERDs, mockups, wireframes, and architecture diagrams.

getting-datacloud-schema
Retrieve Data Lake Object and Data Model Object schema from Salesforce Data Cloud via REST APIs.

handling-sf-data
Create, update, delete, and bulk import/export Salesforce records using sf CLI and anonymous Apex.

harmonizing-datacloud
Harmonize and unify Salesforce Data Cloud schemas, mappings, identity resolution, and profiles.

implementing-ui-bundle-agentforce-conversation-client
Embed and configure Agentforce Conversation Client in UI Bundle projects.