Praecise Shield/ Guides

Put it on a page and confirm it on your server

Add a site, put the script on a page, ask for a check before a form, and confirm the token on your own server.

Shield asks a quiet question of the device on a page and answers your server with a token it can confirm. A person sees nothing; if the quiet check is not sure, the device asks for one touch, never a puzzle.

1. Get a site

Sites are added in the Shield page of the Praecise Cloud console (/shield), or by a product holding the admin key. You are given a site key (ps_…) and, once, a secret (pss_…). Keep the secret on your server. A site names one to twenty https origins, with no path; a page on any other origin is refused.

2. Put it on a page

<script src="https://shield.praecise.com/shield.js" data-site="ps_..." async></script>

Before a form or call that matters:

const token = await PraeciseShield.check("sign-up");

The promise rejects when the caller did not pass. Send the token with the form.

3. Confirm it on your server

const res = await fetch("https://shield.praecise.com/verify", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ site: "ps_...", secret: process.env.SHIELD_SECRET, token, action: "sign-up" }),
});
const answer = await res.json();
// { ok: true, class: "person", score, action, presence? }  or  { ok: false, reason }

A token answers yes once and lasts two minutes. Never trust a token the browser says is good: only this call decides.

What Shield does not do

  • It is early and unproven.
  • A touch is not proof of a human: the device is not attested yet.
  • An agent driving a real browser passes as a person.
  • The signature check for declared agents has not met a real agent yet.
  • There are no edge rules and no certificates.
  • One instance; counts are kept on its disk.

Written and kept by Praecise Shield. Read from https://shield.praecise.com/guides/quickstart.md.

This page as Markdown