Prism client integration
Prism is a single async script. It profiles the connecting browser (anonymization + automation signals) and returns an opaque assessment id you verify server-side.
Install
Add the tag with your publishable key. It runs on load, no init call needed:
<script async id="_farox" src="https://cdn.farox.io/f.js?k=<publishable key>"></script>
Prism exposes the result three ways, use whichever fits:
- a
farox:prismDOM event whosedetailis the assessment - the
window.__faroxPrismglobal FaroxPrism.check(cb)to re-run and get a callback- and it auto-fills any
<input name="farox_token">in the page
// the assessment is delivered as an event and on a global document.addEventListener("farox:prism", function(e) { const a = e.detail // { id, anonymized, network_type, ... } form.farox_token.value = a.id }) // or read it any time const a = window.__faroxPrism FaroxPrism.check(function(a){ /* re-run on demand */ })
Awaiting the assessment
The check runs asynchronously (about a second), so a fast user can submit before it lands and you would post an empty token. Gate your submit button on the assessment: FaroxPrism.onAssessment(cb) fires as soon as the verdict is ready, or immediately if it already is, and FaroxPrism.getAssessment() returns the current verdict or null.
// disable submit until Prism is ready submitBtn.disabled = true FaroxPrism.onAssessment(function (a) { form.farox_token.value = a.id submitBtn.disabled = false })
This is a UX convenience, not a security control, the server-side assessment retrieval is the real boundary.
Frameworks & edge
In Next.js load it with next/script; in React inject it in a useEffect and read the event; at the edge (Cloudflare / Fastly / CloudFront) you do not run the browser script, you call the Context API on the connecting IP instead. Copy-paste snippets for each live in the console under Prism → Integration.