BISC8 + Next.js
App Router + Pages Router — beforeInteractive strategy.
BISC8 + Next.js: GDPR consent live in 60 seconds, no extra hydration cost.
Perché BISC8 per Next.js
App Router native
<Script strategy="beforeInteractive"> mounts the CDN script before client hydration, blocking trackers from the first paint.
Server actions friendly
BISC8 cookies are accessible from server actions via headers().cookies(). Persist consent decisions without client roundtrip.
Edge runtime compatible
CDN bundle is zero-dep and runs in any V8 isolate. Vercel/Cloudflare Pages compatible.
Setup (4 passi)
1. Register domain
Sign up at app.bisc8.app and add your production domain. Free tier covers 1 domain unlimited.
✓ Domain status shows "verified" or "pending" — both are fine for snippet install.
2. Paste the script in root layout
Edit app/layout.tsx (App Router) or pages/_document.tsx (Pages Router). Use Next.js <Script> component with strategy="beforeInteractive".
✓ Open DevTools Network tab → load page → request to cdn.bisc8.app/v1/boot.js returns 200.
3. Replace data-domain
Swap the example.com placeholder for your live hostname. Must match exactly the domain registered in BISC8.
✓ window.bisc8.version should equal "v1.6.3" in browser console.
4. Deploy + verify banner
vercel deploy → open in incognito → banner renders bottom-center. Accept / reject / customize all functional.
✓ BISC8 dashboard /domains/[id]/insights shows >0 receipts after first session.
Snippet di codice
Sostituisci example.com con il tuo dominio BISC8 registrato.
// app/layout.tsx — Next.js 13+ App Router
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
src="https://cdn.bisc8.app/v1/boot.js"
data-domain="example.com"
strategy="beforeInteractive"
/>
</head>
<body>{children}</body>
</html>
);
}Risoluzione problemi
Banner not appearing in production
Verify the script tag includes data-domain that matches your registered host (no protocol, no path). Check CSP headers — boot.js needs to load from cdn.bisc8.app.
CSP errors in console
Add `script-src https://cdn.bisc8.app` and `connect-src https://app.bisc8.app` to your CSP. Strict-CSP-friendly: BISC8 never uses inline scripts on host page.
Hydration mismatch warning
Make sure the <Script> is inside <head>, not the React tree. The beforeInteractive strategy bypasses hydration.
How to revoke consent programmatically
window.bisc8.withdraw() clears the cookie and dispatches consent.revoke webhook.
Guide correlate
Pronto al lancio?
Crea un account in 30 secondi, copia lo snippet, banner live in 60s totali.
Inizia gratis con Next.js