@areyouhuman/sdk
v0.1.0
Published
Passive behavioral human verification — replace CAPTCHAs with involuntary micro-signal analysis
Maintainers
Readme
@areyouhuman/sdk
Passive behavioral human verification — replace CAPTCHAs with involuntary micro-signal analysis.
📦 12kb gzipped · ⚡ Zero dependencies · 🔒 Privacy-first · 🚫 No cookies
Quick Start
npm install @areyouhuman/sdkimport { AreYouHuman } from '@areyouhuman/sdk/react';
function LoginPage() {
return (
<AreYouHuman
siteKey="ayh_live_xxxxxxxxxxxxxxxx"
onVerified={(token, score) => {
// Send token to your backend for server-side verification
fetch('/api/verify', { method: 'POST', body: JSON.stringify({ token }) });
}}
theme="dark"
/>
);
}How It Works
The SDK captures 5 behavioral signal channels from normal user interactions:
| Channel | Signal | |---------|--------| | Pointer Dynamics | Velocity variance, path curvature from micro-corrections | | Scroll Entropy | Shannon entropy of scroll velocity distribution | | Keystroke Rhythm | Inter-key timing coefficient of variation | | Micro-Tremor | Involuntary oscillation in pointer displacement | | Temporal Coherence | Cross-channel Pearson correlation |
All processing runs entirely in the browser. No data is sent to any server — only a signed verification token.
Modes
// Inline — shows progress bar in your form
<AreYouHuman mode="inline" ... />
// Modal — centered overlay
<AreYouHuman mode="modal" ... />
// Invisible — zero UI, runs silently
const { verify, isVerifying } = useAreYouHuman({ siteKey: '...', mode: 'invisible' });
const result = await verify();Server Verification
Always validate tokens on your backend:
import { verify } from '@areyouhuman/sdk/server';
const result = await verify({
token: req.body.token,
secretKey: process.env.AYH_SECRET_KEY!,
});
if (result.success && result.score >= 0.5) {
// Human verified ✓
}Express Middleware
import { middleware } from '@areyouhuman/sdk/server';
app.post('/api/submit',
middleware({ secretKey: process.env.AYH_SECRET_KEY! }),
(req, res) => res.json({ ok: true })
);Full Documentation
License
MIT © 2026 HumanSign Protocol
