Skip to content

change log for aliased preview urls #23668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Test out code changes before shipping with per-branch preview deployments for Cloudflare Workers
description: Get shareable preview links for every code change you make to a Cloudflare Worker, making it easier to test and collaborate before going live
products:
- workers
date: 2025-07-23T01:00:00Z
---

Now, when you connect your Cloudflare Worker to a git repository on GitHub or GitLab, each branch of your repository has its own stable preview URL, that you can use to preview code changes before merging the pull request and deploying to production.

This works the same way that Cloudflare Pages does — every time you create a pull request, you'll automatically get a shareable preview link where you can see your changes running, without affecting production. The link stays the same, even as you add commits to the same branch.
These preview URLs are named after your branch and are posted as a comment to each pull request. The URL stays the same with every commit and always points to the latest version of that branch.

![PR comment preview](src/assets/images/changelog/workers/preview-urls-comment.png)

## Preview URL types

Each comment includes **two preview URLs** as shown above:

* **Commit Preview URL**: Unique to the specific version/commit (e.g., `<version-prefix>-<worker-name>.<subdomain>.workers.dev`)
* **Branch Preview URL**: A stable alias based on the branch name (e.g., `<branch-name>-<worker-name>.<subdomain>.workers.dev`)

## How it works

When you create a pull request:

- **A preview alias is automatically created** based on the Git branch name (e.g., `<branch-name>` becomes `<branch-name>-<worker-name>.<subdomain>.workers.dev`)
- **No configuration is needed**, the alias is generated for you
- **The link stays the same** even as you add commits to the same branch
- **Preview URLs are posted directly to your pull request as comments** (just like they are in Cloudflare Pages)

## Custom alias name

You can also assign a custom preview alias using the [Wrangler CLI](/workers/wrangler/), by passing the `--preview-alias` flag when [uploading a version](/workers/wrangler/commands/#upload) of your Worker:

```bash
wrangler versions upload --preview-alias staging
```

## Limitations while in beta

* Only available on the **workers.dev** subdomain (custom domains not yet supported)
* Requires **Wrangler v4.21.0+**
* Preview URLs are not generated for Workers that use [Durable Objects](/durable-objects/)
* Not yet supported for [Workers for Platforms](/cloudflare-for-platforms/workers-for-platforms/)
Loading