@crawlguard/nextjs
v2.1.2
Published
CrawlGuard AI bot detection for Next.js - one-line integration
Maintainers
Readme
@crawlguard/nextjs
Next.js integration for CrawlGuard bot detection. One line in your proxy.ts — blocking, challenges, and rate limiting are managed from the dashboard.
Install
npm install @crawlguard/nextjsSetup
Add your site key to .env:
CRAWLGUARD_SITE_KEY=cg_your_site_keyCreate proxy.ts in your project root:
export { crawlGuardProxy as proxy } from '@crawlguard/nextjs'Done. All traffic decisions (block, challenge, throttle, allow) are controlled from your CrawlGuard Dashboard.
Custom Config
import { createCrawlGuard } from '@crawlguard/nextjs'
export const proxy = createCrawlGuard({
siteKey: 'cg_your_site_key',
exclude: ['/_next', '/favicon.ico', '/api/health'],
challengePath: '/challenge',
})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
