Skip to content

Commit

Permalink
add note about DO bindings in the getPlatformProxy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Feb 25, 2024
1 parent 7434eac commit faa51d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/workers/wrangler/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,14 @@ The bindings supported by `getPlatformProxy` are:

* [Durable Object bindings](/workers/configuration/bindings/#durable-object-bindings)

* To use a Durable Object binding with `getPlatformProxy`, you need to always specify a `script_name` for it
and have the target worker run in a separate terminal via `wrangler dev`.

For example in your project's `wrangler.toml` file you have a Durable Object with certain `class_name`
and `script_name` set to `"my-worker"`. The same exact `class_name` is also used by a Durable Object binding
in your `my-worker` worker, and you are running the worker via `wrangler dev`.
Calling `getPlatformProxy` will then successfully generate a proxy to the Durable Object defined in the `my-worker` worker.

* [R2 bucket bindings](/workers/configuration/bindings/#r2-bucket-bindings)

* [Queue bindings](/workers/configuration/bindings/#queue-bindings)
Expand Down

0 comments on commit faa51d9

Please sign in to comment.