Widget Integration (No-Code)
Drop-in script for Squarespace, Webflow, WordPress, and similar platforms.
Use this when:
- You don't have access to backend code
- You want the fastest setup possible
- You're using Squarespace, Webflow, Wix, WordPress, or similar
Implementation
<script src="https://cdn.magentrust.ai/v1/magen-trust.min.js"></script>
<script>
MAGENTrust.init({
siteId: 'YOUR_SITE_ID',
apiKey: 'YOUR_PUBLIC_API_KEY',
mode: 'auto', // or 'manual' for specific forms
// Optional configuration
thresholds: {
low: 0.3, // Block below this score
medium: 0.5,
high: 0.7 // Allow above this score
},
onVerified: function(result) {
console.log('Human verified:', result.entropyScore);
},
onBlocked: function(result) {
console.log('Bot blocked:', result.reason);
alert('Please interact with the form naturally before submitting.');
}
});
</script>Manual Mode (Protect Specific Forms)
MAGENTrust.init({
siteId: 'YOUR_SITE_ID',
apiKey: 'YOUR_PUBLIC_API_KEY',
mode: 'manual'
});
// Protect a specific form by CSS selector
MAGENTrust.protect('#contact-form', {
onSubmit: function(event, verification) {
if (!verification.verified) {
event.preventDefault();
alert('Bot detected. Please try again.');
return false;
}
return true;
}
});Advanced Configuration
MAGENTrust.init({
siteId: 'YOUR_SITE_ID',
apiKey: 'YOUR_PUBLIC_API_KEY',
trackMouse: true,
trackKeyboard: true,
trackClicks: true,
trackScroll: true,
adaptiveThresholds: true,
mobileScoreBoost: 0.2,
accessibilityMode: true,
blockBehavior: 'soft',
retryEnabled: true,
maxRetries: 3,
debug: true
});