Cloudflare Workers gets a template collection

Cloudflare has released a new set of starter templates for its Workers developer platform, available at workers.new/templates. The collection moves beyond the standard "Hello, World" example and targets real-world use cases that combine multiple Cloudflare developer products and external services.

The templates are designed to reduce the time spent on project configuration, letting developers jump straight into building. Examples in the repository include an image sharing site built with Pages Functions, direct creator uploads to Cloudflare Stream, and a Durable Object-powered request scheduler.

One highlighted template demonstrates how to accept payments for video content using Pages Functions, Cloudflare Stream, and Stripe Checkout. In that setup, Stripe Checkout redirects to a URL that verifies the Stripe token and generates a signed Cloudflare Stream URL for viewing the video. The signed URL is time-limited and can be restricted by country or IP address, so the entire flow works without managing a database or persisting state.

Deploy straight from the repo

Every template in the templates repository and the collection site includes a Deploy with Workers button. Clicking it authorizes GitHub to fork the repository and deploy it via GitHub Actions, using a Cloudflare Workers-powered GitHub action. The whole deployment process is intended to take under five minutes. Alternatively, templates can be opened directly in StackBlitz, which creates a working fork in the browser.

Built-in test support

The templates also include scaffolding for test-driven development. A number of them are configured to run integration tests against a local server using Wrangler's unstable_dev API together with the Vitest test framework. This gives developers a ready-made pattern for writing end-to-end tests rather than bolting on test infrastructure later.

Browser-based development with StackBlitz

The StackBlitz option builds on the partnership Cloudflare announced earlier this year during Platform Week. StackBlitz runs on WebContainers, a WebAssembly-based operating system that boots Node.js environments in the browser tab. Each template includes an Open with StackBlitz button, so a full development environment is available with nothing more than a web browser.

The template repository is open to contributions — developers can submit pull requests to add new templates to the collection. Community sharing happens in the #builtwith channel on Cloudflare's Discord server.