Marech for Next.js & React Apps
Add one script tag to monitor scraper traffic — then, because you own the deployment, block non-JS scrapers at the edge with Next.js middleware.
How Marech protects a Next.js site
A Next.js or React app is code you deploy yourself, so you get both modes. The monitoring snippet goes into your root layout (or index.html for a plain React SPA), and because you control the server or edge, you can add a middleware check that returns a 403 to scrapers before your page is ever rendered.
Monitoring — the snippet
One line of JavaScript in your <head>. It reports scraper traffic to your dashboard and overlays JS-running bots. Works on Next.js in ~5 minutes.
Blocking — the edge check
A server-side check (Next.js / Vercel edge middleware) returns a 403 to scrapers before your content is served — the only thing that stops non-JS scrapers.
Before you begin
You'll need a couple of things ready. The monitoring step needs only the first two.
- A Marech account — start a free trial (no credit card).
- Access to edit your Next.js site's theme, settings, or code.
- Your app deployed somewhere you control the edge — Vercel, Cloudflare, or your own server.
Install the monitoring snippet
One line of JavaScript that reports scraper traffic to your dashboard. Works on every Next.js plan and takes about ~5 minutes.
<script> tag is present in <head> — for SSR/SSG apps it should appear in the server-rendered HTML.Turn on real blocking (optional)
Stops non-JS scrapers before your content is served, using Next.js / Vercel edge middleware. Needs a Marech API key and a block policy.
Verify it's blocking. With middleware deployed, a fake GPTBot request returns a 403 while a real browser loads your app normally.
curl -A "GPTBot/1.0" -I https://yourapp.com/