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

OptionDefaultMeaning
room—Room ID.
apiUrlhttps://api.waitrooms.devWhere keys and room state come from.
queueUrlhttps://waitrooms.devWhere the waiting page lives.
failOpentrueLet visitors in if keys can't be fetched and none are cached.
checkRevocationtrueHonor the emergency "send everyone to the queue" control.

Prefer your own JWT library? See Passes and verification.

Something unclear? Email hello@waitrooms.dev.