@crawlguard/js
v2.0.0
Published
CrawlGuard AI bot detection - Core JS/TS SDK
Maintainers
Readme
@crawlguard/js
Core SDK for CrawlGuard bot detection. Used internally by framework packages like @crawlguard/nextjs and @crawlguard/express.
For most projects, use the framework-specific package instead — it's a one-liner:
// Next.js (proxy.ts)
export { crawlGuardProxy as proxy } from '@crawlguard/nextjs'
// Express
app.use(crawlGuard('cg_your_site_key'))Blocking, challenges, and rate limiting are all managed from the CrawlGuard Dashboard. The SDK enforces the API's decision automatically.
Direct Usage
If you need to build your own integration:
npm install @crawlguard/jsimport { CrawlGuard } from '@crawlguard/js'
const guard = new CrawlGuard('cg_your_site_key')
const signals = CrawlGuard.extractFromRequest(req)
const result = await guard.verify(signals)
// result.action = 'allow' | 'block' | 'challenge' | 'throttle'Fails open — if the API is unreachable, verify() returns { action: "allow" }.
License
MIT
