# Quantum JavaScript/Web SDK — Customer Quick Start Get access - Open the Quantum API Telegram bot: https://t.me/quantum_adminapi - Send /start, choose My SDK, then choose JavaScript. - Contact the Quantum API administrator through the bot to receive your individual Quantum API key. - Documentation: https://quantumrealtime.online/ Install the SDK - Install the published package with: npm install quantum-realtime-web-sdk - Package page and version history: https://www.npmjs.com/package/quantum-realtime-web-sdk - Your Quantum API key is supplied separately. Save it on your backend as Quantum_key.txt. Keep Quantum_key.txt on your trusted server, outside the public website directory. Add it to .gitignore. Never put the permanent key in browser JavaScript, a public folder, source control, or a mobile/desktop app. Backend setup 1. Copy backend/quantum_realtime_proxy.py from node_modules/quantum-realtime-web-sdk/backend/ into your FastAPI backend. 2. Mount the proxy with your application's real login dependency: from backend.quantum_realtime_proxy import create_quantum_realtime_router app.include_router(create_quantum_realtime_router(require_customer_login)) Replace require_customer_login with your actual authenticated-user dependency. Do not use a no-op dependency. 3. Configure these server environment values: QUANTUM_API_ORIGIN=https://quantum-api-gateway.netlify.app QUANTUM_API_KEY_FILE=/private/path/Quantum_key.txt 4. Make the application's Vite/Webpack/other bundler resolve the SDK import from npm. The backend proxy route must be available at /api/quantum/realtime on the same origin. Browser example Add elements with IDs output, status, prompt, reference-image, start, and stop. Give #output a visible height. Then use this as a JavaScript module: import { QuantumRealtimeClient } from "quantum-realtime-web-sdk"; const $ = (id) => document.getElementById(id); const sdk = new QuantumRealtimeClient({ viewElement: $("output"), backendUrl: "/api/quantum/realtime", onStatus: (message) => { $("status").textContent = message; }, }); $("stop").disabled = true; $("start").addEventListener("click", async () => { $("start").disabled = true; try { await sdk.start({ prompt: $("prompt").value, referenceFile: $("reference-image").files[0], cameraPosition: "front", }); $("stop").disabled = false; } catch (error) { $("status").textContent = `Could not start: ${error.message}`; $("start").disabled = false; } }); $("stop").addEventListener("click", async () => { $("stop").disabled = true; try { const receipt = await sdk.stop(); $("status").textContent = `Ended: ${receipt.billed_credits} Quantum credits billed.`; } catch (error) { $("status").textContent = `Could not stop: ${error.message}`; } finally { $("start").disabled = false; } }); Camera access requires HTTPS or localhost. Reference images may be JPG, PNG, or WebP up to 5 MB; they upload when generation starts. Click Stop when finished so the session closes and billing settles. Quantum bills at the rate shown by the API for confirmed active time.