Integration
To start using Code Defender, you must integrate HUMAN's Sensor. There are two types of Sensor integrations:
- First-party, which is served locally from your domain. We highly recommend the first-party integration because of its improved performance.
- Third-party, which does not have prerequisites for integration, but has lower performance.
Below are some best practices to ensure your Sensor performs optimally.
1. Snippet code
Use HUMAN's provided snippet code for integration. Below is an example for PX_SENSOR_URL
- //client.px-cloud.net/PX1234/main.min.js
using the recommended first-party integration.
<script src="PX_SENSOR_URL" async ></script>
<script type="text/javascript">
(function(){
// Custom parameters
// window._pxParam1 = "<param1>";
}());
</script>
<script src="PX_SENSOR_URL" async />
2. Snippet location
Insert the snippet should within the <head>
tag. The visibility of the Sensor can be affected if you do not insert the snippet in the <head>
tag.
3. Snippet order
Insert the snippet at the top of the <head>
tag. If you place it lower, coverage will be less effective.
First party installation without an Enforcer
Note
Installation without an Enforcer requires HUMAN support. Contact us for more information.
Because Enforcers aren't required for Code Defender applications, you can implement a reverse proxy through your backend if you need a first-party installation without an Enforcer. This passes the request for the sensor resource through your backend to our CDN.
The implementation details depend on your backend architecture and, in particular, whether the first endpoint your resource requests hit is a CDN, load balancer, etc. For example, if you serve resources through a Fastly CDN, you can set it up to proxy the sensor resource request to the HUMAN CDN. Here is an example of how it can be done with a Fastly CDN.
Updated 19 days ago