Introduction
The Automation API lets you verify the integrity of the Kameleoon application file loaded on your website, confirming that it hasn’t changed and is safe to use on your site. The integrity verification process generates a hash code from the contents of the application file, then compares it to the hash code of the file your website loads. Both hash codes must match every time. This document guides you through implementing this health check, which keeps the application file secure from tampering.The API generates only a hashCode. Decide how to use the generated hash to secure the Kameleoon application file.
Sample implementation of the integrity check
To obtain the hash code of the original Kameleoon application file, call the Automation API. First, gain access to the Automation API using OAuth 2.0 and reference the relevant documentation. As shown in the example below, after you make a request to the API endpoint to retrieve the hash code, compare it with the hash code you calculate on your end to confirm no one has tampered with the file.Kameleoon doesn’t continuously verify the application files hosted on its CDN for each customer. Instead, you determine how to verify the application files and which actions to take if hash codes mismatch, based on your specific requirements. As a safe practice, promptly remove the application file link from your website if you detect a mismatch.
The domain for your Kameleoon scripts may differ between projects. Depending on when you created your projects, they may use either
kameleoon.eu or kameleoon.io. Use the domain that appears in your project within the Kameleoon App.