Age Gate Mode
Implement full screen blocking with loader v4.
Important
The v4 loader does not expose a native data-age-gate attribute. Blocking is managed on the partner site side.
Overlay example
<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>Unlock after success
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);
}
}⚠️
The grant_code happens in window.location.hash, not in req.query on the server side.