|
| 1 | +--- |
| 2 | +title: Remote bindings GA - Connect to remote resources (D1, KV, R2, etc.) during local development |
| 3 | +description: You can now connect to R2 buckets, D1 databases, and other resources running on Cloudflare, while running your Worker's code locally, on your own machine. |
| 4 | +products: |
| 5 | + - workers |
| 6 | +date: 2025-09-16 |
| 7 | +--- |
| 8 | + |
| 9 | +import { WranglerConfig, Aside } from "~/components"; |
| 10 | + |
| 11 | +Three months ago [we announced the public beta](/changelog/2025-06-18-remote-bindings-beta/) of [remote bindings](/workers/development-testing/#remote-bindings) for local development. Now, we're excited to say that it's available for everyone in Wrangler, Vite, and Vitest without using an experimental flag! |
| 12 | + |
| 13 | +With remote bindings, you can now connect to deployed resources like [R2 buckets](/r2/) and [D1 databases](/d1/) while running Worker code on your local machine. This means you can test your local code changes against real data and services, without the overhead of deploying for each iteration. |
| 14 | + |
| 15 | +## Example configuration |
| 16 | + |
| 17 | +To enable remote bindings, add `"remote" : true` to each binding that you want to rely on a remote resource running on Cloudflare: |
| 18 | + |
| 19 | +<WranglerConfig> |
| 20 | + |
| 21 | +```jsonc title="wrangler.jsonc" |
| 22 | +{ |
| 23 | + "name": "my-worker", |
| 24 | + "compatibility_date": "$today", |
| 25 | + |
| 26 | + "r2_buckets": [ |
| 27 | + { |
| 28 | + "bucket_name": "screenshots-bucket", |
| 29 | + "binding": "screenshots_bucket", |
| 30 | + "remote": true, |
| 31 | + }, |
| 32 | + ], |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +</WranglerConfig> |
| 37 | + |
| 38 | +When remote bindings are configured, your Worker **still executes locally**, but all binding calls are proxied to the deployed resource that runs on Cloudflare's network. |
| 39 | + |
| 40 | +**You can [try out remote bindings](/workers/development-testing/#remote-bindings) for local development today with:** |
| 41 | + |
| 42 | +- [Wrangler v4.37.0](/workers/wrangler/) |
| 43 | +- The [Cloudflare Vite Plugin](/workers/vite-plugin/) |
| 44 | +- The [Cloudflare Vitest Plugin](/workers/testing/vitest-integration/) |
0 commit comments