When integrating the Userpilot SDK into your application, one important consideration is ensuring the security and integrity of the code you load from external sources. This is where Subresource Integrity (SRI) comes in.
curl
and openssl
commands. Replace VERSION
in the command with the appropriate SDK version you are using:
curl
command downloads the SDK script from Userpilot’s CDN.
openssl
command computes the SHA-384 hash of the downloaded script in binary format.
openssl
command encodes the binary hash in Base64 format, which is the required format for SRI.
sha384-
when setting it in your configuration or as the integrity
attribute in your HTML.