Skip to content

Conversation

@agents-git-bot
Copy link
Contributor

@agents-git-bot agents-git-bot bot commented Jan 3, 2026

Summary

Documents the new custom token support for the exposePort() method added in cloudflare/sandbox-sdk PR #329.

Changes

  • API Reference: Updated exposePort() parameter documentation to include optional token parameter
  • New validatePortToken() method: Complete documentation with examples for custom authentication scenarios
  • Preview URLs concept: Enhanced URL format explanation with token behavior differences
  • Stable URLs guide: Practical examples showing custom tokens for production environments

Key Features Documented

  • Optional token parameter (1-16 chars: a-z, 0-9, -, _)
  • Stable URLs across container restarts and deployments
  • Token collision prevention and validation
  • Timing-safe token comparison for security
  • Production use cases and best practices

Related

This enables users to maintain consistent preview URLs for production environments, shared demos, and external integrations instead of random regenerated tokens.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

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 token parameter to exposePort() method signature
- Document token requirements (1-16 chars, lowercase alphanumeric + hyphens/underscores)
- Add examples showing custom tokens for stable URLs vs auto-generated tokens
- Explain use cases for stable URLs across deployments and restarts
- Update TypeScript examples with both usage patterns

Ref: cloudflare/sandbox-sdk PR #329
@agents-git-bot agents-git-bot bot changed the title Document custom token support in exposePort (sandbox-sdk#329) Add custom token support to exposePort for stable preview URLs Jan 13, 2026
- Add optional token parameter to exposePort() API documentation
- Include examples showing auto-generated vs custom token usage
- Document token validation rules (1-16 chars, lowercase alphanumeric + hyphens/underscores)
- Update URL format examples to include tokens in preview URLs
- Add stable URL use cases for production deployments and URL sharing
- Update guides with custom token examples for consistent URLs across restarts

Sync documentation for cloudflare/sandbox-sdk PR #329: Add custom token support to exposePort for stable preview URLs
Fix merge conflicts in ports.mdx API documentation and provide clean,
comprehensive coverage of the custom token feature for exposePort().

Includes validatePortToken() method documentation and complete examples
for stable preview URLs across deployments.
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