Skip to content

feat: add bot detection functionality #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

harlan-zw
Copy link
Contributor

Add server-side bot detection based on user agent analysis and header inspection without complex behavioral tracking.

Features:

  • Comprehensive bot classification (search engines, social, SEO, AI, etc.)
  • Header anomaly detection for suspicious clients
  • Client-side composable for accessing bot detection state
  • Complete test coverage for bot detection logic

🤖 Generated with Claude Code

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

harlan-zw and others added 8 commits June 18, 2025 13:47
Add server-side bot detection based on user agent analysis and header
inspection without complex behavioral tracking.

Features:
- Comprehensive bot classification (search engines, social, SEO, AI, etc.)
- Header anomaly detection for suspicious clients
- Client-side composable for accessing bot detection state
- Complete test coverage for bot detection logic

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Add comprehensive bot detection functionality combining server-side header
analysis with advanced client-side detection and persistent storage.

Features:
- Server-side bot detection using user agent and header analysis
- Client-side enhanced detection with browser characteristic analysis
- Reactive Vue composable with computed properties and watchers
- Persistent storage using VueUse localStorage with 1-hour cache
- Comprehensive bot classification (search engines, social, SEO, AI, etc.)
- Confidence scoring and detection method tracking
- Organized bot constants in separate const-bots.ts file
- All functions exported from util.ts for external usage
- Complete test coverage and comprehensive documentation

Client-side detection includes:
- WebDriver and automation tool detection
- Missing browser API checks
- Screen and plugin anomaly detection
- User agent consistency validation
- Headless browser indicators

Documentation:
- Guide: Bot Detection (2.guides/4.bot-detection.md)
- API: useBotDetection() (3.api/2.use-bot-detection.md)
- Nitro API: isBotFromHeaders() (3.nitro-api/1.is-bot-from-headers.md)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant