Documentation

Browser SDK

Use the published browser package for the direct integration path.

install

npm install @captchacc/browser

mount and verify

The SDK sends browser requests with credentials enabled. If a site accepts shared clearance and the browser already has a valid captcha.cc clearance cookie, the SDK can receive a proof token without rendering a new image challenge.

import { createCaptcha } from "@captchacc/browser";

const captcha = await createCaptcha(document.getElementById("captcha"), {
  siteKey: "pk_live_xxx",
  apiBase: "https://captcha.cc"
});

const result = await captcha.verify(userAnswer);
if (result.ok) {
  await fetch("/submit-form", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ proofToken: result.proofToken })
  });
}

refresh

await captcha.refresh();