Scripts
You should include the Centinel Analytica scripts onto each page that contains a protected endpoint. For example if you are protecting the login endpoint, you should add the scripts to the login page, but also every other page that contains the login form.
To include the scripts on a page, add a HTML script tag immediately below the <head>
. Make sure to replace SITE_KEY
with your site key.
<html>
<head>
<script src="https://collector.centinelanalytica.com/script.js?site_key=SITE_KEY"></script>
<!-- Rest of the head -->
</head>
<body>
<!-- Page content -->
</body>
</html>
Waiting for Centinel Analytica
In order to ensure that Centinel Analytica has finished loading the script and is ready to protect your website, you should wait for window.cen.initialized
to be true
and if not wait for the "CentinelInitialized" event to be fired.
if (window.cen && window.cen.initialized) {
login();
} else {
window.addEventListener('CentinelInitialized', login);
}
Dashboard
Your Centinel Analytica dashboard is where you can control which parts of your digital assets are protected. It allows you to gain insights into a range of analytics and metrics to monitor your website's traffic. First, take note of your API Keys. Then, configure the endpoints you would like to protect.
Validation
When a user sends a request to a protected endpoint, you should contact the validation API for a decision on whether to allow it.