Skip to content

Deploy to Cloudflare button

The README button opens Cloudflare’s deploy flow directly, using templates/cloudflare in the public repository as its source. Cloudflare copies that directory into the creator’s GitHub/GitLab account and builds a Cloudflare Worker. It requires the source repository and its exact runtime, store, and CLI package versions to be publicly available.

templates/starter remains the maintained source for all four adapters. The Cloudflare distribution is generated, excluded from the maintainer workspace, and checked for drift. Node.js, Vercel, and Netlify scaffolding continues through the existing CLI. Never hand-edit the generated Cloudflare directory.

Terminal window
pnpm generate:cloudflare
pnpm verify:cloudflare
pnpm test:cloudflare-starter

Build the runtime, store, and CLI before these commands. The generator reuses the CLI’s adapter-config transformation and copies source using the private-file exclusion policy. The standalone distribution contains pinned registry versions, a published free example course, the native agent toolkit, and default-off optional features. Its build scripts and binding descriptions live in scripts/cloudflare-profile.

The consumer check runs outside the repository, installs locally packed release artifacts through a loopback registry, builds a production Cloudflare fixture, verifies paid lesson exclusion, and packages the Worker with wrangler deploy --dry-run. It never publishes packages or deploys anything.

After the exact package versions are available on npm, run:

Terminal window
pnpm lock:cloudflare

Commit the resulting standalone pnpm-lock.yaml. This command fails if a required version is unavailable instead of creating a lockfile with local paths, fake integrity, or test-registry URLs. Re-run it when regenerating for a new release, and qualify the actual public package installation before promoting the button as ready to use.

The deploy screen prompts for STRATO_SECRET; Wrangler vars carry the public canonical URL and abuse-control acknowledgment. Configure the same secret for both build and runtime. Set PUBLIC_SITE_URL to the final HTTPS origin and acknowledge the abuse controls only after configuring them. The build rejects placeholders and missing secrets, writes an ignored local bindings file for workerd prerendering, and preserves other Wrangler configuration. Secrets are never copied into public vars.

The button starts with free content. Payment/email credentials and optional store/media bindings are configured separately when the creator enables them. See adoption activity for what we can measure about uptake.