Server-side protection
Verify Waitrooms passes on any server or edge runtime with the gate function or plain JWT verification.
gate() uses only web-standard APIs, so it runs in Cloudflare Workers, Deno, Bun, Node 20+ and any framework that hands you a Request.
TypeScript
import { gate } from "@waitrooms/sdk";
export default {
async fetch(request: Request) {
const redirect = await gate(request, { room: "your-room" });
if (redirect) return redirect; // Send them to the line, or tidy the URL.
return handle(request); // They hold a valid pass.
},
};Options
| Option | Default | Meaning |
|---|---|---|
room | — | Room ID. |
apiUrl | https://api.waitrooms.dev | Where keys and room state come from. |
queueUrl | https://waitrooms.dev | Where the waiting page lives. |
failOpen | true | Let visitors in if keys can't be fetched and none are cached. |
checkRevocation | true | Honor the emergency "send everyone to the queue" control. |
Prefer your own JWT library? See Passes and verification.
Something unclear? Email hello@waitrooms.dev.