Complete age verification solution with privacy protection and regional compliance
<!-- Include the SDK -->
<script src="https://sdk.emblemapp.com/emblem-sdk.js"></script>
<!-- Initialize and show age gate -->
<script>
const emblem = new EmblemSDK({
apiKey: 'pk_live_your_api_key'
});
// Show age gate with two options
await emblem.showAgeGate({
configuration: 'us-config', // Your named configuration
callbackUrl: window.location.href
});
</script>
"Verify Now" for new users, "Sign in with Emblem" for returning users
Secure, passwordless authentication for returning users
All verifications route through Emblem (never direct to provider)
Multiple configurations for different jurisdictions
Optimized for touch devices with proper sizing
Optional account creation after verification
Show the age verification UI with automatic handling:
// Show age gate with both verification options
await emblem.showAgeGate({
configuration: 'us-config',
callbackUrl: window.location.href,
onVerifyNow: () => {
console.log('User starting new verification');
},
onSignIn: () => {
console.log('User attempting passkey sign-in');
}
});
Automatically select configuration based on user location:
// Define your configuration mapping
const configMap = {
'US': 'us-config',
'TX': 'us-strict-config', // Texas-specific
'CA': 'ca-config',
'GB': 'eu-config',
'DE': 'eu-config',
'FR': 'eu-config'
};
// Auto-select configuration
const configuration = await emblem.selectConfigurationByRegion(configMap);
// Use selected configuration
await emblem.showAgeGate({
configuration,
callbackUrl: window.location.href
});
Process the result when users return from verification:
// Check for callback on page load
const result = await emblem.handleCallback();
if (result && result.verified) {
// User successfully verified
console.log('Verification level:', result.verificationLevel);
// Account creation will be offered automatically
// Continue to age-gated content
window.location.href = '/members-only';
} else if (result && !result.verified) {
// Verification failed or expired
console.log('Verification failed');
// Show age gate again
await emblem.showAgeGate({
configuration: 'us-config',
callbackUrl: window.location.href
});
}
Users who click "Sign in with Emblem" will use passkeys:
// This happens automatically when using showAgeGate()
// But you can also trigger it directly:
try {
const result = await emblem.authenticateWithPasskey();
if (result.status === 'verified') {
// User authenticated successfully
window.location.href = '/welcome-back';
} else if (result.status === 'insufficient_level') {
// User needs higher verification level
// Upgrade prompt will show automatically
}
} catch (error) {
console.error('Passkey authentication failed');
}
The SDK is designed mobile-first with:
Display the age verification UI with "Verify Now" and "Sign in with Emblem" options.
configuration (string, required) - Named configuration to usecallbackUrl (string, required) - URL to redirect after verificationonVerifyNow (function) - Called when user clicks "Verify Now"onSignIn (function) - Called when user clicks "Sign in with Emblem"onClose (function) - Called if user closes the age gateProgrammatically create a verification session.
configuration (string, required) - Named configuration to usecallbackUrl (string, required) - URL to redirect after verificationdisplay (string) - 'redirect' to redirect immediatelymetadata (object) - Optional metadataProcess verification callback and offer account creation.
Trigger passkey authentication for returning users.
Helper to select configuration based on detected region.
For additional support and documentation: