Subresource integrity (SRI)
Subresource Integrity (SRI) lets a browser check a script against a published code value before running it. Use this optional installation when your website requires that check for the Boei loader.
How to get there: Open Widgets to choose your website and check its widget and conditions. Add the installation code in your website platform.
The integrity value below is a hash: a code calculated from the script’s contents. The browser compares it with the downloaded file.
Version 1.0.0
Script: https://cdn.boei.help/hello-1.0.0.js
SHA-384 integrity value:
sha384-2QbQZILEv7keGb/qKnJ6dSUw3Rq2/zdiINwB30SHzK5cud6sjtPcG5qBdu7ZOfSC
This version's file contents must remain unchanged. Future loader changes use a new version and hash. Updates to your widget settings do not require a new loader or hash.
Check your website domain
This loader identifies your website using the current page's hostname, such as example.com. It does not use a widget key.
Before changing your installation, check that your website in Boei is saved as the plain domain, for example example.com, without www., https://, or a path. Boei ignores www. when looking up your website. A website saved only as www.example.com will not match: correct the domain in Boei or contact support before switching. Other subdomains, such as shop.example.com, need their own matching domain in Boei. Check the default widget and conditions too.
Install the code
Add this code once, site-wide, before the closing </head> or </body> tag:
<script
src="https://cdn.boei.help/hello-1.0.0.js"
integrity="sha384-2QbQZILEv7keGb/qKnJ6dSUw3Rq2/zdiINwB30SHzK5cud6sjtPcG5qBdu7ZOfSC"
crossorigin="anonymous"
async>
</script>
Use your website's custom code feature or ask your developer to add it.
Switching from the WordPress plugin
- Check the plain domain and widget in Boei as described above.
- Deactivate the Boei WordPress plugin, but keep it installed so you can switch back if needed. Do not delete your website or widget in Boei.
- Add the code above using your theme's custom code feature or a code snippets plugin that supports site-wide HTML.
- Clear any WordPress page cache and CDN cache.
- Open your public website and check that the expected widget appears. Check both the
wwwand non-wwwaddress if your site serves both. - Once the new installation works, delete the inactive Boei plugin. If the widget does not appear, remove the custom code, reactivate the plugin, clear caches, and contact support.
Do not leave the old Boei installation code in your theme, tag manager, or another code plugin. Loading both installations can load the widget twice.
What this verifies
The hash verifies hello-1.0.0.js only. The loader fetches additional JavaScript containing the widget and website settings. Those additional scripts are not covered by this hash. Check with your security assessor whether this scope meets your requirements.
Sites with a Content Security Policy
If your site uses a Content Security Policy (CSP), ask your developer to check the permissions needed by your widget. The loader needs https://cdn.boei.help in script-src. Widget scripts, requests, fonts, and panels may need the widget host in script-src, connect-src, font-src, and frame-src. That host is normally https://app.boei.help; a custom widget domain can replace it. Boei branding images use https://cdn.boei.help in img-src.
The widget also adds inline styles, which a strict style-src policy can block. Have your developer and security assessor review this alongside SRI before switching. Other enabled features may need additional permissions. SRI does not replace CSP.
Check the published hash
Your developer can download the versioned file and check its SHA-384 value:
curl -fSLo hello-1.0.0.js https://cdn.boei.help/hello-1.0.0.js
openssl dgst -sha384 -binary hello-1.0.0.js | openssl base64 -A
Compare the result with the published integrity value above, excluding its sha384- prefix.
Updating the loader
When you choose a newer loader version, update both the script URL and its integrity value together. Do not use the hash above with the automatically updated hello.js URL.