Skip to content

Conversation

@agents-git-bot
Copy link
Contributor

@agents-git-bot agents-git-bot bot commented Dec 1, 2025

Summary

Documents the TypeScript generic type support added in cloudflare/sandbox-sdk#264, which fixes type errors when extending the Sandbox class with custom methods.

Changes

New Guide: Extend Sandbox class

  • Complete guide on extending Sandbox with custom methods (/sandbox/guides/extend-sandbox.mdx)
  • Worker configuration examples (wrangler.toml, export setup)
  • Type-safe environment interface patterns
  • Best practices for custom methods (focused methods, error handling, input validation)
  • Complete working example of a CodeExecutorSandbox class

API Reference Updates

  • Updated getSandbox() signature to document generic type parameter
  • Added section explaining usage with custom Sandbox classes
  • Included TypeScript examples showing proper type inference
  • Cross-reference to new Extend Sandbox guide

Related

Synced from: cloudflare/sandbox-sdk#264

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/sandbox/ @whoiskatrin, @ghostwriternr, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents

- Add new guide explaining how to extend Sandbox with custom methods
- Update getSandbox() API reference to document generic type parameter
- Include TypeScript examples showing custom Sandbox usage
- Add best practices for custom methods

This documents the fix from PR #264 which made getSandbox and SandboxEnv
generic to support extending the Sandbox class without type errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants