# Connect a website to Baton (for AI coding agents) Baton (https://batonedit.com) lets a site's owner edit its text, photos and links on the live page. Connecting a site means adding ONE line of HTML to it. You do not change the design, the content, the build or the hosting. Follow these steps in order. ## Before you start - The human has a Baton account and has added the site in Baton (the "Add site" button). If not, stop and ask them to. - You need the Baton site id. It is on the site's page in Baton, and it is in the snippet below. If you do not have it, ask the human. Never guess it. - Never ask for, read or type the human's Baton password, tokens or any other secret. ## The line to add Replace SITE_ID with the real site id: ```html ``` In JSX (React, Next.js), write `crossOrigin="anonymous"` instead of `crossorigin="anonymous"`. It must be on every page, so it goes in the shared layout or the page template, inside or just before . ## Where it goes, by stack - Plain HTML: add the line to every page, in . If there are many pages, tell the human before editing them all. - Next.js (App Router): in app/layout.tsx, inside (or the end). Next.js (Pages Router): pages/_document.tsx, in . - Astro, Eleventy, Hugo and other static generators: the base layout's . - Vite or Create React App: index.html in . - WordPress: add the line through the theme (header.php or a code-snippets plugin). Do not edit WordPress core. - Shopify: layout/theme.liquid, in . - Webflow or Framer: the site's custom code (head or footer). You cannot do this from a code repository: tell the human exactly what to paste and where. ## Rules - Add only that line. Do not change copy, styles, SEO tags, scripts or configuration. - If a content security policy blocks it, allow the Baton address (https://batonedit.com) for script-src and connect-src, and tell the human what you changed. - Work on a branch and tell the human to review it. Do not push to production unless they say so. - Do not publish or change content in Baton. Publishing is for a person. ## Check it 1. Deploy the change (or ask the human to). 2. Ask the human to open the site's page in Baton and press "Check my site". It turns green when the line is found on the live site. 3. If it does not, view the live page source and confirm the line is present on that page. ## After it is connected - The human invites the client from the site's page in Baton. Handing the site over is free. - If the human has connected Baton's MCP server (https://batonedit.com/api/mcp, with a token from Settings, Integrations), you can also read a page's text and draft changes. They stay drafts until a person presses Publish. More: https://batonedit.com/docs and https://batonedit.com/llms-full.txt