Skip to content

fix(docs): Update Sandbox Env interface to specify Sandbox type#28443

Open
OpeOginni wants to merge 2 commits intocloudflare:productionfrom
OpeOginni:patch-2
Open

fix(docs): Update Sandbox Env interface to specify Sandbox type#28443
OpeOginni wants to merge 2 commits intocloudflare:productionfrom
OpeOginni:patch-2

Conversation

@OpeOginni
Copy link

@OpeOginni OpeOginni commented Feb 19, 2026

Summary

Solution to issue brought up in cloudflare/sandbox-sdk#397

In the Docs on https://developers.cloudflare.com/sandbox/configuration/environment-variables/#pass-worker-secrets-to-sandbox we are shown how to be able to have access to envs from the Env interface, but using that code directly has some type errors.

Following the example given in the Tutorial for persistent storage https://developers.cloudflare.com/sandbox/tutorials/persistent-storage/#3-build-the-data-processor which is correct.

Documentation checklist

@whoiskatrin
Copy link
Contributor

/bonk review this change

Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix — the core change (adding the Sandbox type parameter and re-export) is correct and aligns with the pattern used across other Sandbox docs. A few things to address before merging:

  1. Inconsistent indentation — the changed line uses spaces but the surrounding code uses tabs.
  2. Inconsistent quote style — the new export line uses single quotes while the adjacent import uses double quotes.
  3. Same bug exists in the bucket mounting example further down in this same file (line 284) — it would be good to fix both in one PR.

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 19, 2026

Review submitted. Here's a summary of my feedback on PR #28443:

The fix is correct — adding export { Sandbox } and typing DurableObjectNamespace<Sandbox> matches the established pattern used in all other Sandbox documentation pages (get-started, tutorials, guides, etc.).

Three items to address:

  1. Quote style: The new export line uses single quotes ('@cloudflare/sandbox') while the adjacent import uses double quotes. Suggested switching to double quotes for consistency.

  2. Indentation: The changed Sandbox: DurableObjectNamespace<Sandbox> line uses spaces but the surrounding code uses tabs. Suggested switching to tabs.

  3. Same bug at line 284: The bucket mounting example further down in the same file has the identical issue (DurableObjectNamespace without the <Sandbox> type parameter and missing the export re-export). Suggested fixing both in one PR.

github run

@OpeOginni
Copy link
Author

Fixed Mr Bonk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments