Skip to main content
Agents fetch your pages the way curl does: one GET, no JavaScript. A client-rendered single-page app answers that request with an empty shell — a root <div> and a script tag — so every agent that lands on your site reads nothing. Agentify solves half of this on its own: when it converts a JavaScript-rendered page, it renders the page in a headless browser first, so the conversion carries your real content. The other half is serving that markdown from your domain. A SPA on a CDN — Cloudflare Pages, Vercel, Netlify, S3 behind CloudFront — has no server to mount the SDK middleware in. The fix is an edge function in front of the SPA that implements the same contract: detect agent traffic, serve Agentify markdown, and fall through to the app on everything else, including any Agentify failure. The snippets below are that function for the three common hosts.
You need an API key with the agentify:convert scope, minted in the dashboard under Settings → API keys (the Agentify group’s Convert toggle). Add it to your host as the secret ZEROCLICK_AGENTIFY_KEY. The edge function needs no signing secret — it verifies nothing, so the standalone SDK helpers are all it uses.

Deploy the edge function

Each snippet uses withAgentify from @zeroclickai/sellers — the SDK is web-native, so it runs unchanged in edge runtimes — with a one-line client that supplies the key. withAgentify handles the whole contract: GET-only, detection over Accept and User-Agent, forwarded cache headers plus Vary, and fall-through to your app on any failure.
On another host, port the same shape to its edge runtime, or put a small server in front of the CDN and mount the SDK middleware there — the contract is identical. Detection only fires for markdown-preferring or AI-agent requests, so browsers, asset fetches, and search crawlers never touch the Agentify path; if your host supports path matchers, you can still scope the function to page routes and skip asset paths entirely.

Verify

The first request of each page takes a few seconds while the conversion runs; repeats serve from cache. Remove the key from the environment and the markdown request serves the shell instead — that is the fail-open path working, not a deployment error.

If conversion answers 422 content_too_thin

The error means the page yielded too little readable content even after rendering: the content appears only after user interaction, sits behind a bot wall, or never reaches the DOM at all. Two fixes, in order of preference:
  • Prerender or server-render your marketing pages. Most SPA frameworks can emit static HTML for public pages at build time. That helps every raw-text reader, not just Agentify.
  • Serve the content in the initial HTML. Agentify converts what a fetch (or a headless render of it) can see; content that only exists after a click cannot be converted.
Your billed API needs none of this — agents transact with it through your storefront, which is machine-readable by construction.

Next steps

SDK middleware

The same contract as drop-in middleware, when you do have a server.

REST quickstart

The underlying endpoint: request, response anatomy, and errors.