Skip to main content

Ad Sentinelle SDK Integration

This guide details all SDK integration methods according to your technical stack.

SDK Architecture

The Ad Sentinelle SDK is designed to be lightweight and performant:

  • Size: < 15 KB (gzipped)
  • Dependencies: None (Vanilla JavaScript)
  • Loading: Asynchronous, non-blocking
  • Compatibility: All modern browsers

The recommended method uses our dynamic loader which automatically loads the configuration from your dashboard:

<script src="https://adwall-backend-xxxxx.run.app/v1/loader/SITE_ID.js" async></script>

Advantages

  • ✅ Centralized configuration (changeable without redeployment)
  • ✅ Automatic SDK updates
  • ✅ Optimized for performance
  • ✅ Smart caching

Guides by Framework

Choose your framework for detailed guidance:

FrameworkGuide
HTML / Vanilla JSHTML Integration →
React / Next.jsReact Integration →
Vue.js / NuxtVue Integration →

Configuration Options

The SDK can be configured with advanced options:

<script>
// Global configuration (optional)
window.ADWALL_CONFIG = {
debug: false, // Enable debug logs
delay: 0, // Delay before display (ms)
cookieDomain: null, // Cookie domain
};
</script>
<script src="https://adwall-backend-xxxxx.run.app/v1/loader/SITE_ID.js" async></script>

Available Options

OptionTypeDefaultDescription
debugbooleanfalseEnable console logs
delaynumber0Delay before detection (milliseconds)
cookieDomainstringnullDomain for cookies (subdomains)
onDetectedfunctionnullCallback when ad blocker is detected
onConvertedfunctionnullCallback after conversion

JavaScript Events

The SDK emits events you can listen to:

// Listen for ad blocker detection
window.addEventListener('adwall:detected', (event) => {
console.log('Ad blocker detected!', event.detail);
});

// Listen for wall display
window.addEventListener('adwall:displayed', (event) => {
console.log('Wall displayed', event.detail);
});

// Listen for conversion
window.addEventListener('adwall:converted', (event) => {
console.log('User converted!', event.detail);
});

Event List

EventTrigger
adwall:initSDK initialized
adwall:detectedAd blocker detected
adwall:displayedWall displayed
adwall:closedWall closed (soft mode)
adwall:convertedConversion validated
adwall:errorError occurred

Single Page Applications (SPA)

For SPAs (React, Vue, Angular), the SDK automatically handles route changes. No additional configuration is needed.

If you want to manually re-check:

// Re-check ad blocker after navigation
window.AdSentinelle?.check();

Content Security Policy (CSP)

If your site uses strict CSP, add these directives:

script-src 'self' https://adwall-backend-xxxxx.run.app;
connect-src 'self' https://adwall-backend-xxxxx.run.app;
style-src 'self' 'unsafe-inline';

Testing in Local Environment

To test locally (localhost), add localhost to the authorized domains list in your dashboard.

Note

Don't forget to remove localhost before going to production.

Integration Verification

See our verification guide to ensure your integration is correct.