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

  1. Download vibe-editor-cloudflare-pages.zip (also offered during onboarding) and unzip it.
  2. 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:

NameKindWhat it is
VIBE_ACCOUNT_KEYSecretYour 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_PASSWORDSecretThe password for /vibe-editor.
VIBE_SESSION_SECRETSecretAny 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

  1. Open https://your-site/vibe-editor and enter the password.
  2. You land back on the site with the switch in the corner. Turn on edit mode, click a heading, paragraph or picture, and save.
  3. 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

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.

ActionCredits
AI text suggestion1
AI picture5
AI suggestion for a page title or meta description1 each
Saving text you typed, a picture from the library or by URL, alt text, a title or descriptionFree

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).

Read more on the blog