Cert++
Close

Trusted sites for external scripts in a store

Key Takeaway

Trusted sites for scripts belong to one Experience Builder site, unlike Trusted URLs in Setup, which cover every site in the org. If the "+ Add Trusted Site" button is missing, change the security level from Strict CSP to Relaxed CSP and click "Allow".

A B2B Commerce store's website is managed in Experience Builder. In Experience Builder, the site's Content Security Policy (CSP) security level controls which scripts the site can run. Sometimes a store needs a script hosted outside Salesforce, such as a third-party JavaScript file. In that case, you add the external host as a trusted site so the script can load.

CSP security levels

Each Experience Builder site has a "Security level" setting. Strict CSP is the default security level for sites created in Spring '19 and later.

Strict CSPRelaxed CSP
SecurityRecommended by Salesforce for optimum securityModerate
Inline scriptsAll blockedAllowed to run
Remote JavaScript filesAll requests blocked unless the host is explicitly allowedLoaded only from explicitly allowed hosts
Where you allow third-party script hosts"Trusted Sites for Scripts" area, which appears after you select this level"Trusted Sites for Scripts" area, which appears after you select this level
Lightning LockerTurned on automatically, and you can turn it offTurned on automatically, and you can turn it off
Salesforce Accredited B2B Commerce Administrator Professional Study Guide

Checklist progress

0/149Learned

Leverage platform features such as Experience Cloud to enhance the Buyer and Buyer Manager experiences

0/28

Self-registration for a B2B store

Learn this concept

Guest access for a B2B store

Learn this concept

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Salesforce Accredited B2B Commerce Administrator Professional studiers.