Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BD-3303] Clarify CDN directives for Web SDK #8556

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,26 @@ braze.initialize(apiKey, {

### connect-src {#connect-src}

- `connect-src https://sdk.iad-01.braze.com`: allows the SDK to communicate with Braze APIs.
- Change this URL to match your `baseUrl` initialization option's [API SDK endpoint]({{site.baseurl}}/user_guide/administrative/access_braze/sdk_endpoints/).
|URL|Information|
|---|-----------|
|`connect-src https://sdk.iad-01.braze.com`|Allows the SDK to communicate with Braze APIs. Change this URL to match the [API SDK endpoint]({{site.baseurl}}/user_guide/administrative/access_braze/sdk_endpoints/) for your chosen `baseUrl` initialization option.|
{: .reset-td-br-1 .reset-td-br-2 role="presentation"}

### script-src {#script-src}

- `script-src https://js.appboycdn.com`: required when using the CDN-hosted integration.
- `script-src 'unsafe-eval'`: required when using the integration snippet which contains reference to `appboyQueue`
- To avoid using this directive, integrate using NPM instead.
- `script-src 'nonce-...'` or `script-src 'unsafe-inline'`: required for certain in-app messages (for example, custom HTML).
|URL|Information|
|---|-----------|
|`script-src https://js.appboycdn.com`|Required when using the CDN-hosted integration.|
|`script-src 'unsafe-eval'`|Required when using the integration snippet which contains reference to `appboyQueue`. To avoid using this directive, [integrate the SDK using NPM]({{site.baseurl}}/developer_guide/platform_integration_guides/web/initial_sdk_setup/?tab=package%20manager) instead.|
|`script-src 'nonce-...'`<br>or<br>`script-src 'unsafe-inline'`|Required for certain in-app messages, such as custom HTML.|
{: .reset-td-br-1 .reset-td-br-2 role="presentation"}

### img-src {#img-src}
- `img-src: appboy-images.com braze-images.com cdn.braze.eu`: required when using Braze CDN-hosted images. These hostnames may vary based on dashboard cluster.

|URL|Information|
|---|-----------|
|`img-src: appboy-images.com braze-images.com cdn.braze.eu`|Required when using Braze CDN-hosted images. Hostnames may vary based on dashboard cluster.<br><br>**Important:** If you're using custom fonts, you also need to include:<br>`font-src https://use.fontawesome.com`.|
internetisaiah marked this conversation as resolved.
Show resolved Hide resolved
internetisaiah marked this conversation as resolved.
Show resolved Hide resolved
{: .reset-td-br-1 .reset-td-br-2 role="presentation"}

## Font Awesome {#font-awesome}

Expand All @@ -63,6 +71,6 @@ braze.initialize(apiKey, {

If you choose to use Font Awesome, the following CSP directives are required:

- `font-src https://use.fontawesome.com`
- `style-src https://use.fontawesome.com`
- `style-src 'nonce-...'` or `style-src 'unsafe-inline'`
- `font-src https://use.fontawesome.com`