@crawlguard/express
v2.0.0
Published
CrawlGuard AI bot detection for Express.js - one-line middleware
Maintainers
Readme
@crawlguard/express
Express.js middleware for CrawlGuard bot detection. One line — blocking, challenges, and rate limiting are managed from the dashboard.
Install
npm install @crawlguard/expressUsage
import express from 'express'
import { crawlGuard } from '@crawlguard/express'
const app = express()
app.use(crawlGuard('cg_your_site_key'))Done. The middleware calls the CrawlGuard API on every request and enforces the action (block, challenge, throttle, allow) automatically.
Protect Specific Routes
app.use('/api', crawlGuard('cg_your_site_key'))Access Result Downstream
app.get('/data', (req, res) => {
const { classification, score, action } = req.crawlguard
res.json({ classification, score })
})Response Headers
Every request gets observability headers:
x-crawlguard-score— bot score (0–1)x-crawlguard-classification—human,bot,suspiciousx-crawlguard-action—allow,block,challenge,throttle
License
MIT
