Get R2Bucket (or similar) by bucket name in API

R2 bucket bindings are statically defined in wranger.toml. I need to access buckets by name in code. Buckets are created dynamically and so a static definition per worker won't work. Something like this would be ideal: env.BUCKETS.get(buckerName) -> R2Bucket | null. If I can just use fetch from the worker that'd be fine - but I'd like to make the requests within the CF environment as efficiently as possibe.
1 Reply
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Dynamically bindings are currently not supported but I’d recommend posting this in #workers-feature-suggestions
Want results from more Discord servers?
Add your server