Host this HTML page anywhere (GitHub Pages, Netlify, etc.). It will automatically use your Tenant ID to generate keys via our router, saving them directly to your Firebase.
<!-- Demo Key Generator HTML -->
<!DOCTYPE html>
<html>
<head>
<title>Get Key</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<button onclick="generateLink()">Generate Key Link</button>
<script>
// REPLACE THIS WITH YOUR TENANT ID FROM DASHBOARD
const ADMIN_ID = "YOUR_TENANT_ID_HERE";
async function generateLink() {
try {
// Hitting the SaaS Router
const res = await axios.post('https://your-saas-domain.com/api/v1/generate-device', {
adminId: ADMIN_ID
});
if(res.data.status) {
window.location.href = res.data.redirectUrl; // Redirects to URL King
} else {
alert('Error: ' + res.data.error);
}
} catch(e) { alert('Failed to contact server.'); }
}
</script>
</body>
</html>