[Workers] Callout AsyncLocalStorage as a Workers alternative for getPlatformProxy #13146
Labels
content:new
Request for new/missing content
documentation
Documentation edits
product:workers
Related to Workers product
Which Cloudflare product(s) does this pertain to?
Workers
Subject Matter
ALS as a way to get req/env/ctx anywhere in Workers
Content Location
getPlatformProxy allows users to access their Workers bindings and mock information like
req.cf
andctx.waitUntil()
, allowing them to write code for Workers without using Wrangler's development emulation (i.enext dev
when usingnext-on-pages
)The availability of these variables, without having to pipe them from a handler, is a common request on Workers and can be done with AsyncLocalStorage.
The current documentation for getPlatformProxy states...
It would be helpful if there was a guide on using AsyncLocalStorage to do the same, and link out to it - I suspect people will come across this page when trying to figure out if that use-case is possible.
The top 5 results for a Google search of "cloudflare workers asynclocalstorage for env" are:
Additional information
No response
The text was updated successfully, but these errors were encountered: