What you need
- Access to your HTML shell (app.html, layout.tsx, or index.html)
Load synchronously first in <head>
Embed the precompiled Shadow DOM bundle (14 KB gzip budget for the core, plus a fixed allowance per paid module) synchronously as the first script in
<head>. Avoidasyncanddefer, sowindow.Limesand GCM defaults exist before any third-party script runs.HTML <head><script src="https://cdn.uselimes.com/v1/your-site-id.js"></script>Block scripts and iframes with markup
Give a script
type="text/plain"anddata-limes-categorywith the category. External scripts getdata-srcinstead ofsrc. Limes starts them only once the visitor consents to that category, in document order.Iframes get
data-limes-categoryanddata-src. Until consent, Limes shows a placeholder in their place whose button grants only that category.HTML<script type="text/plain" data-limes-category="statistics" data-src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script> <iframe data-limes-category="marketing" data-src="https://www.youtube-nocookie.com/embed/ID"></iframe>Gate custom scripts via window.Limes
For your own logic, check consent synchronously with
window.Limes.has(...)and subscribe tolimes:changefor later decisions and withdrawals.JavaScript / TypeScriptif (window.Limes?.has("statistics")) { initAnalytics(); } window.addEventListener("limes:change", ({ detail }) => { if (detail.selection.marketing) { loadAdPixel(); } });Configure Content-Security-Policy (CSP)
Limes needs no
unsafe-inlineorunsafe-eval. Simply allow your script host inscript-srcandconnect-src.CSP directivesscript-src 'self' https://cdn.uselimes.com; connect-src 'self' https://consent.uselimes.com;Run automated scans in CI/CD
Run the 5-state Playwright scanner before every release. Limes also scans your site on a schedule: monthly on Free and Starter, weekly on Professional, daily from Business.
CLI command (exit 0 = clean, 1 = violation)bun run scan --url https://www.example.com --site sites/your-site.json --json
Frequently asked questions
Can the banner CSS clash with Tailwind or our design system?
No. The UI renders completely encapsulated inside Shadow DOM and only reads explicit --ds-* CSS custom properties if configured.