# CSP Trusted Site Metadata — Implementation Guide ## File location ```text force-app/main/default/cspTrustedSites/{Name}.cspTrustedSite-meta.xml ``` The `cspTrustedSites/` directory must be a direct child of `force-app/main/default/`. Create it if it does not exist. --- ## File naming convention The file name must match the `` value inside the XML, with `.cspTrustedSite-meta.xml` appended. | Domain | fullName | File name | |--------|----------|-----------| | `https://images.unsplash.com` | `Unsplash_Images` | `Unsplash_Images.cspTrustedSite-meta.xml` | | `https://api.open-meteo.com` | `Open_Meteo_API` | `Open_Meteo_API.cspTrustedSite-meta.xml` | | `https://tile.openstreetmap.org` | `OpenStreetMap_Tiles` | `OpenStreetMap_Tiles.cspTrustedSite-meta.xml` | **Naming rules:** - Use PascalCase with underscores separating words (e.g. `Google_Fonts_Static`) - Name should describe the provider and resource type (e.g. `Pexels_Videos`, not just `Pexels`) - Must be unique across the org - Maximum 80 characters --- ## XML template ```xml {UNIQUE_NAME} {DESCRIPTION} {HTTPS_ORIGIN} true All {true|false} {true|false} {true|false} {true|false} {true|false} {true|false} ``` --- ## Field reference | Field | Required | Description | |-------|----------|-------------| | `fullName` | Yes | Unique API name. Must match the file name (before `.cspTrustedSite-meta.xml`). | | `description` | Yes | Human-readable purpose. Start with "Allow access to..." | | `endpointUrl` | Yes | The external origin (scheme + host). Must start with `https://`. No trailing slash. No path. | | `isActive` | Yes | Always `true` for new entries. Set `false` to disable without deleting. | | `context` | Yes | `All` (applies to all contexts). Other values: `LEX` (Lightning Experience only), `Communities` (Experience Cloud only), `VisualForce`. Use `All` unless there is a specific reason to restrict. | | `isApplicableToConnectSrc` | Yes | `true` if the domain is called via `fetch()`, `XMLHttpRequest`, or WebSocket. | | `isApplicableToFontSrc` | Yes | `true` if the domain serves font files (`.woff`, `.woff2`, `.ttf`, `.otf`). | | `isApplicableToFrameSrc` | Yes | `true` if the domain is loaded in an `