One iframe,or the wholelive feed.
Drop a themed debate room into any page, or build your own interface on the same real-time events the room uses.
- Waiting for events…
The real event names and payloads, played out on a demo debate. Use the controls to send your own.
Quickstart
From trial to a live room on your page in three steps.
Get your connection code
Start a trial, then open Connection in your dashboard. Your code looks likedm_eyJwYXJ0…k3Jx9Qand stays the same until you rotate it.Link your admin portal
In your platform admin, open Debates, then Connection, paste the code and press Connect. Your dashboard switches to Connected, and debates show “Powered by Debates Master”.Embed the room
Paste the iframe wherever the debate should appear. Debaters need the microphone permission.
index.html<iframe src="https://debatesmaster.com/embed/your-debate-id" width="100%" height="700" style="border: none;" allow="camera; microphone; display-capture; autoplay" ></iframe>
Embed a room
Four URL parameters theme the room. Change them here and the live room reloads with your colors.
<iframe
src="https://debatesmaster.com/embed/your-debate-id?primary=3341c9&bg=f4f5f7&text=121318"
width="100%"
height="700"
style="border: none;"
allow="camera; microphone; display-capture; autoplay"
></iframe>/embed/preview?primary=3341c9&bg=f4f5f7&text=121318…Real-time events
The room talks to Debates Master over Socket.IO. Join a debate and you receive the same events the embedded room uses.
import { io } from "socket.io-client";
// Pass a viewer token so the visitor can chat and vote.
const socket = io("https://api.debatesmaster.com", {
auth: { token: viewerToken },
});
socket.on("connect", () => {
socket.emit("debate-join", "your-debate-id");
});
socket.on("debate-floor-update", ({ floorMode }) => {
// "A" | "B" | "BOTH" | "NONE"
});
socket.on("debate-voting-update", ({ results, totalVotes }) => {
// results: { [debaterId]: number }
});You send
debate-joinJoin a debate to start receiving its events.
"your-debate-id"
debate-leaveStop receiving events, for example when the room unmounts.
"your-debate-id"
debate-chat-messagePost to the public chat, or to the proof channel as a debater.
{ debateId: string, room: "PUBLIC_CHAT" | "DEBATER_CHAT", text: string, senderName: string, senderId: string, isProof?: boolean, proofUrl?: string }debate-voteCast a vote for one debater.
{ debateId: string, debaterId: string, userId: string }
You receive
debate-floor-updateWho holds the floor right now.
{ floorMode: "A" | "B" | "BOTH" | "NONE" }debate-chat-messageEvery message, as it was sent, for both channels.
{ room, text, senderName, isProof?, proofUrl? }debate-voting-updateThe full tally after every vote.
{ results: { [debaterId]: number }, totalVotes: number }
Floor modes
Every debate is always in exactly one of four modes. The moderator changes it, and debate-floor-update tells you.
"A"First debater speaks
Debater A’s mic is open. Debater B is muted, not disconnected.
"B"Second debater speaks
The mirror of A, for rebuttals and replies.
"BOTH"Open floor
Both mics live, for cross-examination.
"NONE"Mics closed
Everyone muted, between rounds or while the moderator speaks.
Server API
Server-to-server requests identify you with your partner ID in the x-partner-id header. Find it under API keys in your dashboard.
Keep it on the server
Never ship your partner ID to browsers or apps. Read it from an environment variable.
// Server-side only
const res = await fetch("https://api.debatesmaster.com/partner/status", {
headers: {
"x-partner-id": process.env.DEBATE_MASTER_PARTNER_ID,
"Content-Type": "application/json",
},
});
const status = await res.json();Connection codes
A connection code links one partner to Debates Master. It is signed, so your admin portal can check it came from us.
dm_PrefixeyJwYXJ0bmVy…Payload, base64.Separatork3Jx9QsVb2…HMAC-SHA256 signature
Stable
The code stays the same until you rotate it, so you can paste it once and forget it.
Rotatable
Rotating issues a new code and invalidates the old one immediately.
Visible
Once linked, your dashboard shows who connected it and when.