Mode Age Gate
Implémentez un blocage plein écran avec le loader v4.
Important
Le loader v4 n'expose pas d'attribut data-age-gate natif. Le blocage est géré côté site partenaire.
Exemple d'overlay
<div id="age-gate" style="position:fixed;inset:0;background:#0b0f1a;z-index:9999;display:flex;align-items:center;justify-content:center;">
<div id="zykay-widget"></div>
</div>
<script src="https://widget-app.zykay.com/v4/loader.min.js"
data-partner-id="pk_live_xxx"
data-success-path="/verified"
data-container="zykay-widget"></script>Déblocage après succès
const hash = new URLSearchParams(window.location.hash.slice(1));
const grantCode = hash.get('grant_code');
if (grantCode) {
const res = await fetch('/api/zykay/exchange', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ grant_code: grantCode }),
});
if (res.ok) {
document.getElementById('age-gate').remove();
history.replaceState({}, '', window.location.pathname + window.location.search);
}
}⚠️
Le grant_code arrive dans window.location.hash, pas dans req.query côté serveur.