Integrate age verification into your website in under 5 minutes with a single <script> tag.
Prerequisites
- An active agecheck.pro account
- A Verifier ID (
v_xxx) obtained from the dashboard - Access to your website’s HTML to insert the script
Step 1 — Include the script
Add the <script> tag just before the closing </body> tag:
<script
src="https://cdn.agecheck.pro/v1/Verify.js"
data-verifier-id="v_yourid"
data-environment="live"
></script>
The SDK auto-initializes as soon as the DOM is ready. No additional JavaScript is required for the default mode.
Script tag attributes
| Attribute | Required | Description |
|---|---|---|
data-verifier-id |
Yes | Your unique Verifier ID (v_xxx) |
data-environment |
No | live (production) or test (sandbox). Default: live |
data-mode |
No | auto or manual. Overrides the mode configured in the dashboard |
data-debug |
No | true to enable console logs. Default: false |
data-container |
No | CSS selector of the container element. Default: body |
data-force-qr |
No | true to force the QR handoff flow on all devices |
Step 2 — Auto mode (default)
When ui_mode is set to auto in the dashboard, the modal appears automatically on page load with no additional code required.
The SDK automatically:
- Detects the
data-verifier-idon the script tag - Calls
GET /api/config/{verifier_id}/to fetch remote configuration - Checks whether the user is already verified (cookie or localStorage)
- If the user is not verified and
modeisauto, shows the verification modal
Step 3 — Trigger mode (manual activation)
When ui_mode is set to trigger in the dashboard (or with data-mode="manual"), the modal does not appear automatically. You must call window.AgeCheck.show() from your own JavaScript:
<button id="btn-access">Access adult content</button>
<script
src="https://cdn.agecheck.pro/v1/Verify.js"
data-verifier-id="v_yourid"
data-mode="manual"
data-environment="live"
></script>
<script>
document.getElementById('btn-access').addEventListener('click', function() {
window.AgeCheck.show();
});
</script>
Step 4 — Listening to the verification complete event
The SDK fires the DOM event agecheck:complete when a user finishes the verification process:
<script>
document.addEventListener('agecheck:complete', function(event) {
const detail = event.detail;
if (detail.success) {
console.log('Verification completed. Method:', detail.method);
document.getElementById('adult-content').style.display = 'block';
} else {
console.log('Verification failed');
}
});
</script>
Verification Persistence
Once verified, the result is stored for the period configured in the dashboard (default: 30 days). Data is stored in:
- Cookie:
agecheck_verified_{verifier_id} - localStorage:
agecheck_verification_{verifier_id}
Debug Mode
Enable debug logs during development:
<script
src="https://cdn.agecheck.pro/v1/Verify.js"
data-verifier-id="v_yourid"
data-debug="true"
></script>
All internal SDK messages appear in the browser console with the prefix [AgeCheck SDK].