Docs · Platforms
Cloudflare Pages
For a static site on Cloudflare Pages: no CMS, no build step, no server. A few Pages Functions add the editor for signed-in editors and write the saved copy straight into every HTML page at the edge, so search engines, link previews and visitors all get the edited page on first paint.
Install
- Download vibe-editor-cloudflare-pages.zip (also offered during onboarding) and unzip it.
- Run the installer against your Pages project:
node vibe-editor-cloudflare-pages/install.mjs ../my-site
It finds the folder Pages serves (from pages_build_output_dir in wrangler.toml), copies the functions, the adapter and the browser files, and leaves files that already exist alone. Run it again to update; add --force to replace what it kept. It also adds a password page at /vibe-editor.
Already have your own functions/_middleware.js? Keep it and call the adapter from it:
import { pageRequest, withVibe } from '../vibe-editor/inject.js';
export async function onRequest(context) {
const response = await context.next(pageRequest(context.request));
return withVibe(context.request, context.env, response);
}
Set up the project
In Cloudflare, open Workers & Pages → your project → Settings → Variables and Secrets and add, for both Production and Preview:
| Name | Kind | What it is |
|---|---|---|
VIBE_ACCOUNT_KEY | Secret | Your site's key: onboarding step 3, or Account → API keys, bound to the site. Vibe Editor then keeps the saved copy and runs the AI. |
VIBE_ADMIN_PASSWORD | Secret | The password for /vibe-editor. |
VIBE_SESSION_SECRET | Secret | Any long random string; signs the session cookie. |
Optional, to keep things on Cloudflare: a KV namespace bound as VIBE_CONTENT (with a VIBE_SITE variable naming the site) keeps the saved copy in KV, and an R2 bucket bound as VIBE_MEDIA keeps AI pictures on your own domain under /vibe-media/. A secret takes effect from the next deploy.
Deploy with Git or npx wrangler pages deploy. A drag-and-drop upload in the dashboard leaves the Functions out.
Use it
- Open
https://your-site/vibe-editorand enter the password. - You land back on the site with the switch in the corner. Turn on edit mode, click a heading, paragraph or picture, and save.
- Your own page updates at once; everyone else sees the change within about half a minute (a minute with KV).
The magnifier next to the gear edits the page's title and meta description; the picture panel has an alt-text field. Sign out with Logg ut at the bottom of the gear's settings; a session otherwise lasts eight hours.
Who can edit
Whoever has the /vibe-editor password edits the whole site; there are no per-user permissions. Writes need the signed session cookie. The AI never runs on the edge and no AI key is ever in the Pages project: suggestions and pictures go to Vibe Editor with the site's key, which meters them.
How edits are kept
- Elements marked
data-vibe-fieldare kept by that name. Everything else is matched by its tag and original text, so restyling the markup keeps the edits; changing the source text goes back to the source, the safe direction. - Pictures are matched by their original source, which stays on the element as
data-vibe-srcthrough any number of swaps. - Title, description,
og:andtwitter:tags are written on the server. On pages the server can't rewrite safely (malformed markup, over 2 MB, not UTF-8) the text is filled in by the browser instead; signed in, theX-Vibe-Editsheader says which.
Running cost
The middleware runs in front of every request. On a busy site keep static assets out of it with a _routes.json next to functions/, leaving /api/vibe/* and /vibe-media/* included:
{
"version": 1,
"include": ["/*"],
"exclude": ["/vibe/*", "/assets/*"]
}
Credits
AI calls are paid from the Vibe Editor account the site key belongs to. Every new account starts with 20 free credits; plans and top-ups are on the pricing section.
| Action | Credits |
|---|---|
| AI text suggestion | 1 |
| AI picture | 5 |
| AI suggestion for a page title or meta description | 1 each |
| Saving text you typed, a picture from the library or by URL, alt text, a title or description | Free |
When the credits run out, the editor says so and links to where you can buy more. If the AI fails, the credits are given back.
The editor's buttons are in Norwegian today. The ones you'll meet most: Endre tekst (edit text), Skriv selv (type it yourself), Endre bilde (change picture), Flere valg (more options), Alt-tekst (alt text), Side i søkemotorer (page in search engines), Foreslå med AI (suggest with AI), Lagre (save) and Koble til Vibe Editor (connect).
Try now