Install · runtime

The agent on Vercel

Runs before the response. On Vercel the agent is one middleware file at the project root.

How it works on Vercel

On Vercel the agent is one middleware file at the project root. It runs at the edge before the response, with any framework or none.

The file

middleware.js — At your project root. Works with or without a framework.

import { next } from '@vercel/edge'
import { reflexa } from './reflexa-agent.js'

const agent = reflexa({ token: process.env.REFLEXA_TOKEN })

export default async function middleware(request, context) {
  try {
    return (await agent.ahead(request, context)) ?? next()
  } catch {
    return next() // never let the agent take the site down
  }
}

export const config = { matcher: '/:path*' }

Get reflexa-agent.js and the site's token from the dashboard's Agent page, put the token in REFLEXA_TOKEN, deploy. Then press Check the connection in the dashboard: it fetches the domain proof from your real domain and the agent is live.

What this install serves

  • counts every AI visit, page by page
  • serves /llms.txt
  • serves the domain proof that binds the token to this host

What it does not: it never sees the page, so robots.txt and Organization data are not switches here — the agent says so instead of pretending. Connect the site's repository in the dashboard and the agent commits those, and a page's title, description, opening and FAQ, itself.

All install guides → · what the agent never does →

Questions people ask

Does anything change on the site when I install it?

No. Installing puts the agent in place and binds it to the site by its token; nothing is applied. Every switch is your click in the dashboard and every word it writes is shown to you first.

Can I take it out?

Remove the file and redeploy. Whatever was last switched on stops being served on the next request. Your checks and the agent's memory stay in your account.

What can this install actually do?

Counts every AI visit, page by page. Serves /llms.txt. Serves the domain proof that binds the token to this host. It never sees the page, so robots.txt and Organization data are not switches here — the agent says so instead of pretending. Connect the site's repository in the dashboard and the agent commits those, and a page's title, description, opening and FAQ, itself.

Is the token a secret?

Yes. It belongs to this one site and should live in an environment variable, never in a file you commit. It grants nothing beyond this site, and the domain proof refuses it from any other host.

Start with the free check. Then tell the agent what you need.

The free check runs the 23 checks on your public pages. Nothing is installed, nothing changes until you press it.

Free check from outside in minutes · the report by email · nothing installed yet