1. Documentation
  2. Deploying
  3. Cloudflare
ReadmeGitHub
  • Introduction
  • Quickstart
  • Text
  • Code
  • Lists
  • Tables
  • Accordion
  • Badge
  • Button
  • Callout
  • Code Block
  • Code Block Group
  • Code Snippet
  • Columns
  • Custom components
  • GitHub
  • Hover Card
  • Mermaid
  • Properties
  • Related Topics
  • Tabs
  • Tree
  • Images
  • Video
  • Files
  • Grain
  • Shade
  • Moss
  • Configuration
  • Content
  • Navigation
  • Site Identity
  • Appearance
  • Header and Footer
  • Fonts
  • Icons
  • Integrations
  • Search
  • OpenAPI
  • AI Chat
  • React Router
  • Astro
  • Next.js
  • Cloudflare
  • Vercel
  • robots.txt
  • sitemap.xml
  • JSON-LD
  • rss.xml
  • llms.txt
  • llms-full.txt
  • .md endpoints

Cloudflare

Deploy a Heyo Docs project to Cloudflare with the framework-specific setup generated by create-heyo-docs.

Loading documentation…

Next.js< PreviousVercelNext >

Powered by heyo

On this page

Create a Cloudflare projectSet the production URLDeployAdd server-only secrets when needed

Choose Cloudflare when creating a Heyo Docs project to get the required adapter, Worker configuration, and deploy script for the selected framework. Documentation pages are prerendered where the framework supports it; Cloudflare runs application routes only when the site needs them, such as Try it or AI Chat.

Create a Cloudflare project

Pass the deployment target to create-heyo-docs. Cloudflare is supported by React Router, Astro, and Next.js:

bun create @heyo-sh/heyo-docs acme-docs --template react-router --deployment cloudflare

Replace react-router with astro or next as needed. The generated project uses the appropriate integration:

FrameworkGenerated deployment integration
React RouterCloudflare Worker and @cloudflare/vite-plugin
Astro@astrojs/cloudflare
Next.jsOpenNext for Cloudflare

Set the production URL

Set siteUrl to the final public HTTPS address before the production build. Heyo Docs uses it for canonical metadata, the sitemap, RSS, and AI-discovery files. It can include the path where the documentation is mounted.

heyo-docs.config.ts
export default heyoDocs({  siteUrl: "https://docs.acme.com",  title: "Acme Docs",  // ...});

Keep this value pointed at the canonical production address. A preview URL is useful for testing, but it should not replace the production siteUrl in the committed configuration.

Deploy

Log in to the Cloudflare account that owns the Worker, then run the generated scripts. The deploy script is framework-specific, so use it instead of a generic static-file upload.

bash
bunx wrangler login
bun run typecheckbun run buildbun run deploy

For React Router, Wrangler deploys the Worker and the built client assets. Astro writes the deployable Worker configuration during bun run build. Next.js runs the OpenNext build as part of bun run deploy. Set a stable, project-specific Worker name in wrangler.jsonc before the first shared release.

Add server-only secrets when needed

A documentation-only site needs no runtime secrets. If AI Chat is enabled, store its provider key in Cloudflare instead of committing it to the project:

bash
bunx wrangler secret put HEYO_DOCS_AI_API_KEY

The generated Cloudflare integrations read that binding on the server. Configure other application secrets with Cloudflare's secret management too; never put them in wrangler.jsonc, MDX, or browser-side configuration.

Continue deploying

  • Configure an OpenAPI reference
  • Add AI Chat