Generate an App from a Template

Salesforce Multi-Framework templates scaffold a fully configured project so you can focus on building features instead of configuring plumbing. The templates include the UIBundle metadata, runtime configuration, framework tooling, and the additional metadata your app needs to run on the Salesforce Platform. You generate an app with the Salesforce CLI, using the same sf commands you use for other Salesforce metadata.

Choose a Template 

Choose a template based on your framework and your app’s audience. Internal templates target employees who sign in with Salesforce credentials, whereas external templates target customers, partners, or public users who reach your app through an Experience Cloud site.

An internal app and an external app use different project templates and platform configuration, and require some additional metadata types to integrate with the Salesforce Platform.

FeatureInternal AppsExternal Apps
AudienceEmployees with Salesforce loginsCustomers, partners, or public users
AuthenticationSalesforce credentials (SSO supported)Experience Cloud guest access or authenticated login
Access pointApp Launcher on desktop and the Salesforce mobile appDigital Experiences app and Experience Cloud site URL
Templatereactinternalapp, angularinternalappreactexternalapp, angularexternalapp
Metadata TypesUIBundle + CustomApplicationUIBundle + Experience Cloud site metadata (DigitalExperience, DigitalExperienceConfig, Network, CustomSite)
Pre-built featuresAgentforce Conversation Client, object searchNavigation, authentication, object search

For more information, see Project Structure and Metadata.

Generate a New Project 

To start a new app, you can generate a Salesforce DX project from an internal or external template. The internal and external app templates scaffold a full project, so you generate them with sf template generate project. The generated project includes the UIBundle and all of the additional metadata the app needs to run.

For example, for an internal React app, use:

1sf template generate project --name MyReactApp --template reactinternalapp
2cd MyReactApp

Or for an external Angular app, use:

1sf template generate project --name MyAngularApp --template angularexternalapp
2cd MyAngularApp

Add a UI Bundle to an Existing Project 

If you already have a Salesforce DX project and want to add an app to it, generate a UI bundle into the existing project rather than scaffolding a new one. Use a bundle-only template in this case, namaly reactbasic for React or angularbasic for Angular.

1sf template generate ui-bundle --name MyApp --template reactbasic

The command adds the app under force-app/main/default/uiBundles/. You supply any additional metadata, such as CustomApplication or Experience Cloud site metadata, separately.

Install Dependencies 

A generated app manages its dependencies with npm. Install them from inside the app’s UIBundle directory, not the project root.

1cd force-app/main/default/uiBundles/MyReactApp
2npm install

The install brings in standard framework tooling (Vite for React, the Angular CLI for Angular), so there’s no custom toolchain to learn.

Next Steps 

After you generate and install your app:

See Also