Content Security Policy (CSP) support

The Web Widget supports websites which use a Content Security Policy (CSP) and follows Google'sstrict CSP guidelines. We recommend following Google's policy for the best support and easiest setup with the widget.

当following these guidelines, add thenonceattribute to the Web Widget snippet.

             
<scriptnonce="{random}"id="ze-snippet"src="https://static.zdassets.com/ekr/snippet.js?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">script>

This{random}value must be a unique cryptographic number that is generated by the server each time the CSP is transmitted.

Note: This security policy works with the messenger version of the Zendesk Web Widget snippet. Ensure that your snippet aligns with the example above.

Custom setup (using other CSP directives)

We cannot guarantee that the Web Widget won't violate a custom CSP that does not follow Google'sguidelines. However, if you add the following directives, it should prevent the widget causing violations:

             
default-src'self'https://static.zdassets.comhttps://ekr.zdassets.comhttps://ekr.亚博.comhttps://{zendeskSubdomain}.亚博.comhttps://api.smooch.iohttps://media.smooch.iohttps://亚博-eu.my.sentry.iohttps://sdk.twilio.comhttps://eventgw.*.twilio.comwss://{zendeskSubdomain}.亚博.comwss://api.smooch.iowss://voice-js.roaming.twilio.com;style-src'unsafe-inline';img-src'self'https://static.zdassets.comhttps://accounts.亚博.comhttps://{zendeskSubdomain}.亚博.comhttps://media.smooch.iohttps://*.zdusercontent.comblob:data:;

If you have custom directives specified such asscript-srcorconnect-src, add the hosts specified indefault-srcabove.