[← All integrations](/getting-started)

Install · Experimental

# Cloudflare Pages / Workers

experimental · edge

agentsite-edge.mjs is a pure Fetch-API port of the snippet. Drop two files into functions/ and your Pages site picks up enrichment on every HTML request.

**Start here first.** Every platform recipe below assumes the canonical Express + Docker install at [/install/express-docker](/install/express-docker). The snippets on this page are the platform-specific deltas on top of that baseline.

`agentsite-edge.mjs` is a pure-Fetch-API port of the snippet that runs at the edge. For Cloudflare Pages, drop two files into `functions/` and your existing static site picks up enrichment on every HTML request.

terminal — downloadcopy

```bash
# Cloudflare Pages — drop into functions/_middleware.js
mkdir -p functions
curl https://api.agentsite.app/agentsite-edge.mjs > functions/agentsite-edge.mjs
curl https://api.agentsite.app/edge/cloudflare-worker.mjs > functions/_middleware.js
```

env varscopy

```bash
# Cloudflare Pages → Settings → Environment Variables
AGENTSITE_TOKEN = asit_xxxxxxxxxxxx      ← mark as Encrypted
AGENTSITE_SITE  = https://yoursite.com
```

**v0.1 — what works:** per-page `<head>` enrichment, JSON-LD schema injection, `.md` content negotiation, `/llms.txt` + `/llms-full.txt` + `/robots.txt` + `/sitemap.xml`, bot UA telemetry. v0.2 adds Cache API integration + the full `/.well-known/*` suite.