KIOSK

Create your account

Free plan, no card required

Minimum 8 characters.
← Back to home

Account created

You're in. The admin dashboard is on its way — for now, here's your access token for the API.

← Back to home
*/ const API_BASE = window.KIOSK_API_BASE || ""; const form = document.getElementById("register-form"); const errorBox = document.getElementById("form-error"); const submitBtn = document.getElementById("submit-btn"); const formState = document.getElementById("form-state"); const successState = document.getElementById("success-state"); const tokenDisplay = document.getElementById("token-display"); form.addEventListener("submit", async (e) => { e.preventDefault(); errorBox.style.display = "none"; const name = document.getElementById("name").value.trim(); const email = document.getElementById("email").value.trim(); const password = document.getElementById("password").value; submitBtn.disabled = true; submitBtn.textContent = "Creating account…"; try { const response = await fetch(`${API_BASE}/auth/register`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: name || undefined, email, password }), }); const json = await response.json(); if (!response.ok) { throw new Error(json?.error?.message || "Something went wrong. Please try again."); } const { token } = json.data; localStorage.setItem("kiosk_token", token); tokenDisplay.textContent = token; formState.classList.add("hidden"); successState.classList.add("visible"); } catch (err) { errorBox.textContent = err.message || "Couldn't create your account. Please try again."; errorBox.style.display = "block"; } finally { submitBtn.disabled = false; submitBtn.textContent = "Create account"; } });