Official isomorphic TypeScript SDK for Blursec — answering one question in front of your /login endpoint: “Is this credential already in the wild?”
What Blursec does
Most authentication breaches don’t happen because someone “hacked” you. They happen because infostealer malware on a user’s device harvested their saved credentials — for your app and every other platform, SaaS, or provider they use — into a stealer-log database, and an attacker logged in with a perfectly valid username + password. Blursec sits in front of your/login endpoint and answers in under 50 ms from a continuously-updated stealer-log feed. If the credential is compromised, the SDK tells you what to do about it.
The SDK exposes four things:
blursec.checkCredential(email, password)— Layer 1. K-anonymity SHA-256 lookup. The raw password never leaves your server.blursec.verifySession(req)— Layer 2. Extracts a session token from a Request, auto-detects JWT vs opaque, hashes appropriately, and looks it up.blursec.webhooks.verify(...)— Verify HMAC-signed deliveries when a previously-clean session shows up in a fresh stealer-log batch after login.dryRun: true— Observe-only mode on any check, so you can stage Blursec into production traffic before enforcing.
Install
The 4-line login endpoint
- Configuration — environments, timeouts, custom fetch
- Errors & fail-open — the error hierarchy and why checks fail open
- Advanced usage — k-anonymity protocol, hash helpers, wire format
- AI agents & MCP — let Claude/Copilot query the database as tools
- Mobile & frontend apps — React, React Native, Flutter integration
How it works (prefix-blinded lookup)
The SDK never sends the raw password to Blursec:- SDK hashes
email + ":" + passwordwith SHA-256 locally → 64-char hex digest. - SDK sends only the first 10 hex characters to the API — one-way, irreversible.
- API returns every entry in that bucket; the SDK compares suffixes locally.

