Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
forcedotcom avatar

Generating Experience React Site

  • 2 installs
  • 787 repo stars
  • Updated August 5, 2026
  • forcedotcom/afv-library

Creates and configures a Salesforce Digital Experience Site to host a React web application, generating the minimal site infrastructure metadata.

About

Generates the Network, CustomSite, DigitalExperienceConfig, and DigitalExperienceBundle metadata needed to serve a React app from a Salesforce Digital Experience Site. A developer uses it to set up site infrastructure for a React web application on Salesforce.

  • React sites act as a thin appContainer delegating rendering to the React app via appSpace
  • Resolves siteName, url prefix, appNamespace, appDevName, and guest access before generating

Generating Experience React Site by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #1,863 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/forcedotcom/afv-library --skill generating-experience-react-site

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars787
Last updatedAugust 5, 2026
Repositoryforcedotcom/afv-library

What it does

Creates and configures a Salesforce Digital Experience Site to host a React web application, generating the minimal site infrastructure metadata.

Files

SKILL.mdMarkdownGitHub ↗

Digital Experience Site for React Web Applications

Create and configure Digital Experience Sites that host React web applications 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 application 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.

PropertyFormatHow to Resolve
siteNameUpperCamelCase (e.g., MyCommunity)Ask user or derive from context
siteUrlPathPrefixkebab-case (e.g., my-community)User-provided, or convert siteName to kebab-case
appNamespaceStringnamespace in sfdx-project.jsonsf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias} → default c
appDevNameStringwebApplication metadata in the project → sf data query -q "SELECT DeveloperName FROM WebApplication" --target-org ${usernameOrAlias} → default to siteName
enableGuestAccessBooleanAsk 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

Call the get_metadata_api_context MCP tool to retrieve schemas for Network, CustomSite, DigitalExperienceConfig, and DigitalExperienceBundle metadata types. These schemas define the valid XML structure for each file.

Create any files and directories that don't already exist, using these paths:

Metadata TypePath
Networknetworks/{siteName}.network-meta.xml
CustomSitesites/{siteName}.site-meta.xml
DigitalExperienceConfigdigitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml
DigitalExperienceBundledigitalExperiences/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 TypeTemplate Reference
Networkconfigure-metadata-network.md
CustomSiteconfigure-metadata-custom-site.md
DigitalExperienceConfigconfigure-metadata-digital-experience-config.md
DigitalExperienceBundleconfigure-metadata-digital-experience-bundle.md
DigitalExperience (sfdc_cms__site)configure-metadata-digital-experience.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.md
  • docs/configure-metadata-custom-site.md
  • docs/configure-metadata-digital-experience-config.md
  • docs/configure-metadata-digital-experience-bundle.md
  • docs/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: Resolve Additional Configurations

Address any extra configurations the user requests. Use the schemas returned by get_metadata_api_context in Step 2 to understand each field's purpose, and update only the minimum necessary fields.

Verification Checklist

Before deploying, confirm:

  • [ ] All five required properties are resolved
  • [ ] All metadata directories and files exist per the project structure
  • [ ] All metadata fields are populated per the templates and user requests
  • [ ] appSpace in content.json matches an existing WebApplication metadata record
  • [ ] Deployment validates successfully:
sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias}

Related skills

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.