Get an API key via the M for Developers API manager.
To install the API key, set window.captchaguardApiKey
(case sensitive) to your API key. E.g:
window.captchaguardApiKey = "your_api_key";
Add this line to your <body>
:
<script src="https://m.vueno.es/moduleflow/main.min.js" type="text/javascript"></script>
then add this line to your <head>
:
<import module="captchaguard" as="js"></import>
// Add an Event listener to handle situations:
document.addEventListener("captchaguard_isHuman", (event) => {
// Add bot-specific logic here
console.log("Custom action for bots! User-Agent: ", event.detail.userAgent);
alert("User is a bot!");
});
If you want to redirect and log the console if the visitor is a bot:
// Add an Event listener to handle situations:
document.addEventListener("captchaguard_isBot", (event) => {
// Add bot-specific logic here
console.log("Custom action for bots! User-Agent: ", event.detail.userAgent);
window.location.href = "example.com";
});
You can also integrate both:
// Add Event listeners to handle situations:
// Bot
document.addEventListener("captchaguard_isBot", (event) => {
// Add bot-specific logic here
console.log("Custom action for bots! User-Agent: ", event.detail.userAgent);
window.location.href = "example.com";
});
// Human
document.addEventListener("captchaguard_isHuman", (event) => {
// Add bot-specific logic here
console.log("Custom action for bots! User-Agent: ", event.detail.userAgent);
alert("User is a bot!");
});
Result goes here