Install guides
Install on Next.js
One middleware file for a Next.js app, wherever it is hosted.
Steps
- Create an API token on the Account page and copy it.
- Add
INTERCRAWL_TOKENwith the token as its value to the environment where your app runs (on Vercel: Project settings, Environment variables). - Save the install file at the root of your project, next to
package.json(or assrc/middleware.tsif your app usessrc/):
Save asmiddleware.tsintercrawl.com/install/v1/next.ts
- Deploy, then press Check install on the Sites page.
Next.js 16 and later
The convention there is called proxy.ts, with the function named proxy. middleware.ts still works and is deprecated. If your project already uses proxy.ts, follow it.
If you already have a middleware
Do not replace it. Save the install file elsewhere, for example lib/intercrawl.ts, and call it at the top of your own function:
import { intercrawl } from "@/lib/intercrawl"; // adjust the path to the file
export async function middleware(request: NextRequest) {
const page = await intercrawl(request);
if (page) return page;
// your middleware as before
}intercrawl(request) answers only crawler requests and returns nothing for everyone else, so the rest of your middleware runs as before. Keep your existing matcher.
Not answered here? Write to hello@intercrawl.com.Next: Install on Vercel (other frameworks)