Requirements

Node.js 18+ (which ships with a built-in global fetch). No extra dependencies are needed for the basic flow.

Generate an outcome

const BASE = "https://api.provable.io";
const clientSeed = "my-app-user-42";

const res = await fetch(
    `${BASE}/api/ints?clientSeed=${encodeURIComponent(clientSeed)}&count=5&min=1&max=100`
);
const data = await res.json();
console.log("outcome:", data.outcome);
console.log("serverHash:", data.serverHash);

Verify it later

const verify = await fetch(
    `${BASE}/api/verifyServerHash?clientSeed=${encodeURIComponent(clientSeed)}&serverHash=${data.serverHash}`
);
const ok = await verify.json();
console.log(ok ? "✅ verified" : "❌ mismatch");

Tips

Next steps