Bot Detection with Botd is a Vercel example template that uses FingerprintJS's Botd library to detect bots at the edge and rewrite them to a blocked page.
What is Bot Detection with Botd?
Bot Detection with Botd is a Next.js boilerplate built for Vercel's Edge Middleware. It takes incoming page requests and, using Botd by FingerprintJS plus botd-integrations, classifies whether the client is a bot before serving content. When a bot is detected, the middleware rewrites the request to a bot-detected page. The template is part of Vercel's official examples collection and includes a live demo at https://edge-functions-bot-protection-botd.vercel.app.
Key Features
- Edge Middleware detection — bot checks run in a Vercel Edge Middleware rewrite, so detection happens before the page reaches the user.
- Botd integration — uses the Botd browser library for bot signatures and botd-integrations to call the Botd API from the edge.
- User-agent manipulation — the middleware changes the request's user agent to a browser user agent before sending it to Botd, demonstrating a detection technique.
- Blocked page rewrite — the /blocked demo path is rewritten to the bot-detected.tsx page when a bot is identified.
- One-click deploy — a Vercel deploy button clones the repository and prompts for the NEXT_PUBLIC_BOTD_API_TOKEN environment variable.
- Local development setup — bootstrap with pnpm create-next-app, copy .env.example to .env.local, and run pnpm dev.
- Tailwind CSS styling — the page is styled with Tailwind CSS according to the template metadata.
- Related bot protection alternative — the example links to a DataDome-based bot protection template for comparison.
Who should use Bot Detection with Botd?
Next.js developers who need a working reference for implementing edge bot detection will find this template directly applicable. Site owners protecting forms, logins, or APIs from scrapers can use it as a starting point to block automated traffic. Teams evaluating bot detection services can compare Botd's free beta approach against alternatives like DataDome.
What can you do with Bot Detection with Botd?
- Protect sensitive routes: use the middleware rewrite pattern to send bots to a blocked page instead of letting them reach forms or dashboards.
- Learn edge middleware: study how a request's user agent is changed and then passed to an external detection API inside Next.js middleware.
- Test Botd's free token: get a free beta token from the Botd GitHub repo and see how it integrates into a real Next.js app.
How does the template work?
Deploy with one click on Vercel or clone the repo locally. Obtain a free Botd API token from the Botd repository and set it as NEXT_PUBLIC_BOTD_API_TOKEN. After copying the environment file and running pnpm dev, the middleware rewrites requests labeled as bots to the bot-detected page.
Pricing
Botd is free during its beta period; you only need to request a token from the Botd GitHub repository. The Vercel example itself has no additional cost.
Alternatives
- DataDome — the related template bot-protection-datadome uses DataDome's commercial bot protection service, which offers a different detection model and pricing structure.
FAQ
Is Bot Detection with Botd the same as FingerprintJS?
No. Botd is a browser library focused purely on bot detection, whereas FingerprintJS also offers device fingerprinting for user identification. The template integrates only Botd.
What do I need to run this template?
You need a free Botd API token, a local Node.js environment with pnpm, and optionally a Vercel account for deployment. The token is set in the NEXT_PUBLIC_BOTD_API_TOKEN environment variable.
Where can I see the detection in action?
The live demo at https://edge-functions-bot-protection-botd.vercel.app has a /blocked route that is rewritten to a bot-detected page when the edge middleware classifies the visitor as a bot.
Does this template work without Vercel?
Yes, it runs locally with pnpm dev. Edge Middleware is a Vercel concept, but you can still test the Next.js app locally; the middleware will execute in the development server.








