Quick Start
Integrate Veiled into your site in 5 minutes
1
Create Account
Sign up at dashboard.veiled.id
2
Install SDK
Choose installation method:
Via CDN (Recommended)
<script src="https://cdn.veiled.id/sdk/v2/veiled.umd.js"></script>🆕 v2.0 includes QR code verification support
Via NPM
npm install @veiled/sdk-js3
Initialize SDK
// Initialize Veiled
const veiled = new Veiled.VeiledClient({
apiKey: 'pk_live_your_api_key_here'
});4
Implement Verification
Add this code where you want to protect content:
// Check se utente è già verificato
const { verified } = await veiled.isVerified();
if (!verified) {
// Avvia processo di verifica
await veiled.verify({
onSuccess: (token) => {
console.log('Utente verificato!', token);
// Mostra contenuto protetto
},
onError: (error) => {
console.error('Verifica fallita', error);
}
});
} else {
// Mostra contenuto protetto
console.log('Utente già verificato');
}Esempio Completo
<!DOCTYPE html>
<html>
<head>
<title>Sito Protetto - Veiled</title>
<script src="https://cdn.veiled.id/sdk/v1/veiled.umd.js"></script>
</head>
<body>
<div id="content" style="display: none;">
<h1>Contenuto Protetto</h1>
<p>Questo contenuto è visibile solo agli utenti verificati.</p>
</div>
<script>
const veiled = new Veiled.VeiledClient({
apiKey: 'pk_live_your_api_key'
});
async function checkAccess() {
const { verified } = await veiled.isVerified();
if (verified) {
document.getElementById('content').style.display = 'block';
} else {
await veiled.verify({
onSuccess: () => {
location.reload();
}
});
}
}
checkAccess();
</script>
</body>
</html>