Quickstart
Five minutes from signup to the first decision in your backend. You need a site (localhost is fine) and a backend that receives the form you want to protect.
1. Create the account
Create a free account on the home page with your e-mail. You get, right away:
- public key
pk_…: goes in the browser; - secret key
sk_…: server only. Shown once; keep it in a vault or an environment variable; - token secret, seal key and proxy secret: server only as well. You can see them again in the dashboard.
You can also create it through the API:
curl -X POST https://siftil.com/v1/signup \
-H 'content-type: application/json' \
-d '{"email": "dev@yourcompany.com", "site": "https://www.yourcompany.com"}'2. Add the tag
On the form page (signup, login, checkout):
<script src="https://siftil.com/v1/agent.js"></script>
<script>
Siftil.observe() // optional: mouse and keyboard behaviour from here on
const siftil = Siftil.identify({ endpoint: 'https://siftil.com/v1', apiKey: 'pk_YOUR_KEY' })
</script>identify takes 150 to 500 ms and runs while the user fills in the form. Start early and only wait on submit.
3. Send the token with the form
form.addEventListener('submit', async (ev) => {
ev.preventDefault()
const { server } = await siftil
const data = Object.fromEntries(new FormData(form))
await fetch('/api/signup', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ ...data, siftilToken: server.token, siftilRequestId: server.requestId }),
})
})4. Check it in the backend
The simplest way is to ask the API with your secret key:
// Node 18+, Bun, Deno, Workers
const r = await fetch('https://siftil.com/v1/verify', {
method: 'POST',
headers: { authorization: 'Bearer ' + process.env.SIFTIL_SK, 'content-type': 'application/json' },
body: JSON.stringify({ token: body.siftilToken }),
})
const t = await r.json() // { valid, rid, vid, ss, risk, bot, new, iat }
if (!t.valid) return res.status(400).send('please reload the page')
if (t.risk === 'high') return requireVerification() // SMS, captcha, manual review
await createAccount({ ...body, visitorId: t.vid, requestId: t.rid })The token is valid for 10 minutes. To stop anyone from reusing the same token for two signups, store the rid and reject a repeated rid. The token carries a summary of the decision; when you need every signal, fetch the event:
curl https://siftil.com/v1/events/REQUEST_ID -H 'authorization: Bearer sk_…'5. After login, link the account to the device
When the user signs in, call again with their ID in your system. That is what separates multi-accounting (fraud) from a shared computer (a clinic front desk, a lab):
Siftil.identify({ endpoint: 'https://siftil.com/v1', apiKey: 'pk_YOUR_KEY', linkedId: user.id })Done. What next?
- Restrict the public key to your domains in the dashboard (Authorized origins).
- Against ad blockers, serve the agent from your own domain with the first-party proxy.
- Label confirmed fraud with labels so the score learns your traffic.
- Read Signals and risk score to choose the thresholds for your rule.
Siftil · API v1 documentation