# AI-Primed for Cloudflare: setup guide

For any website that already runs through Cloudflare. The connector adds the business details and AI guide you approved in AI-Primed to your site as Cloudflare delivers it. Your original website files are never edited.

It does not change DNS, email, firewall or security rules, does not unblock AI agents, and does not promise a score, mention or ranking. Cloudflare security checks can happen before the connector runs.

## What you need

- A website that runs through Cloudflare (orange cloud on).
- An AI-Primed Team or Agency plan, which includes **Fix it for me**. Shopify and WordPress plugin access is separate.
- Cloudflare may charge for usage depending on your Cloudflare plan and traffic.

## Setup

The **Fix it for me** panel in your AI-Primed report shows these same steps with a Copy button for every value.

1. **Approve your content.** In your saved AI-Primed report, open **Fix it for me**. Replace any placeholders with real public facts, tick the review box and approve. New audits never replace an approved version on their own.
2. **Create the connector.** In Cloudflare, open **Workers & Pages**, choose **Create**, then **Start with Hello World**. Name it `ai-primed-connector` and deploy. Choose **Edit code**, replace the sample with `worker.mjs` from this package (or use **Copy connector code** in Fix it for me) and deploy.
3. **Add five settings.** In the connector, open **Settings**, then **Variables and Secrets**:

   | Name | Type | Value |
   | --- | --- | --- |
   | `AI_PRIMED_TOKEN` | Secret | The 48-character token from Fix it for me. Only the token, not the script tag. |
   | `SITE_HOST` | Text | Your exact website address without https, for example `example.com` or `www.example.com` |
   | `SCHEMA_PATHS` | Text | The pages you approved, for example `["/"]` |
   | `SERVE_LLMS` | Text | `true` |
   | `ENABLED` | Text | `true` |

4. **Connect it to your website.** In the connector, open **Settings**, then **Domains & Routes**, choose **Add**, then **Route**, pick your website and enter `example.com/*` using your own address.
5. **Check it worked.** In a private browsing window, open `https://your-site/llms.txt`. You should see your approved guide. View the source of an approved page to see the added business details. Then run a new AI-Primed audit to record what can now be read.

## Good to know

- Test in a private window. Requests that carry cookies, sign-in details or search parameters are passed straight through untouched, so a normal browser tab may show the original page.
- An existing `llms.txt` file always wins. A page that already has structured data is left unchanged. A strict content security policy is respected, not weakened.
- Do not also paste the script tag on the same pages.
- Keep the token private. Do not put it in screenshots or source control.
- If your website is itself hosted as a Cloudflare Worker or Pages project, a route may not apply. Contact AI-Primed for help.
- Enabling the connector does not change your score or mark anything as verified. Only a new audit records what is readable.

## Stopping and undoing

Pause injection in **Fix it for me**, set `ENABLED` to `false`, or remove the route. Your website returns to exactly what it served before. Nothing on the original site needs to be deleted.

## Safeguards

No cookies, personal tracking, different content for bots, background edits or firewall changes. Private paths, non-HTML responses, errors, redirects and private responses are untouched. Approved content requests have a 2.5-second limit, bounded sizes, no redirects and no caching; if AI-Primed is unavailable or delivery is paused, the original page is served. Added responses are marked no-store.

## Verification status

Set up and checked on AI-Primed's own test site on 29 November 2026 (approved guide served, approved business details in the page, both recorded by a fresh audit). This is not a customer result.

## Local tests

From the AI-Primed source checkout: `node --test integrations/cloudflare/worker.test.mjs`. Tests use Cloudflare's local runtime with isolated fixtures; fixtures are not audit evidence.
