Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
DataDome can provide real-time bot protection and other security protections to any website. In this template we'll be using it at the edge.

Astro landing page starter with gradient background, responsive hamburger/dropdown menu, and switchable floating/fullscreen headers.
Bot Protection with DataDome is a Next.js edge middleware template that protects websites from malicious bots in real time by running DataDome's detection service at the edge of Vercel's network.
This template is a reference implementation from Vercel's examples repository for adding bot protection to a Next.js application. It takes incoming web traffic and, using DataDome's real-time bot detection, distinguishes human users from bots before requests reach your origin. The template uses Tailwind CSS for styling and is designed to be deployed on Vercel, either through a one-click deploy or by cloning the repository.
.env.example to .env.local, setting keys, running pnpm dev, and deploying with Vercel.You start by creating a DataDome account and locating your keys in the DataDome dashboard. Then you copy the example environment file, fill in the two key values, and run pnpm dev to test locally. When you're ready, you deploy the project to Vercel and the edge middleware enforces DataDome's decisions on every request.
It requires NEXT_PUBLIC_DATADOME_CLIENT_SIDE_KEY and DATADOME_SERVER_SIDE_KEY. Both values are found in your DataDome dashboard at app.datadome.co/dashboard/config/protection/keys, and you paste them into .env.local.
You can click the Vercel Deploy button on the template page, which clones the repository and prompts you to enter the two environment variables. Alternatively, bootstrap locally with pnpm create next-app --example ... and deploy with Vercel afterwards.
Both are Vercel edge middleware templates for bot detection. This template uses DataDome's managed service, while the BotD template is a related example in the same repository, representing an alternative integration approach.
