Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 13, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@cloudflare/[email protected]

Minor Changes

  • #329 fc1a8ea Thanks @mikenomitch! - Add support for custom tokens in exposePort() to enable stable preview URLs across deployments.

    You can now pass a custom token when exposing ports to maintain consistent preview URLs between container restarts and deployments. This is useful for sharing URLs with users or maintaining stable references in production environments.

    // With custom token - URL stays the same across restarts
    const { url } = await sandbox.exposePort(8080, {
      hostname: 'example.com',
      token: 'my_token_v1' // 1-16 chars: a-z, 0-9, _
    });
    // url: https://8080-sandbox-id-my-token-v1.example.com
    
    // Without token - generates random 16-char token (existing behavior)
    const { url } = await sandbox.exposePort(8080, {
      hostname: 'example.com'
    });
    // url: https://8080-sandbox-id-abc123random4567.example.com

    Custom tokens must be 1-16 characters containing only lowercase letters, numbers, and underscores.

    Breaking change: Tokens can no longer contain hyphens. Existing preview URLs with hyphenated tokens (including some auto-generated ones) will stop working until the port is re-exposed.

Patch Changes

  • #347 efdd0d7 Thanks @roerohan! - Add Cloudflare AI Gateway support to OpenCode integration. Users can now route AI provider requests through Cloudflare AI Gateway for monitoring, caching, and rate limiting by adding a cloudflareAIGateway provider configuration with accountId, gatewayId, and optional apiToken.

  • #342 7da85c0 Thanks @ghostwriternr! - Handle undefined environment variables as "unset" in setEnvVars

    Environment variable APIs now properly handle undefined values:

    • String values are exported as before
    • undefined/null values now unset the variable (runs unset VAR)

    This enables idiomatic JavaScript patterns:

    await sandbox.setEnvVars({
      API_KEY: 'new-key',
      OLD_SECRET: undefined // unsets OLD_SECRET
    });

    Before: sandbox.setEnvVars({ KEY: undefined }) threw a runtime error
    After: sandbox.setEnvVars({ KEY: undefined }) runs unset KEY

    TypeScript types now honestly accept Record<string, string | undefined>.

@github-actions github-actions bot force-pushed the changeset-release/main branch from 6638826 to ff79d82 Compare January 14, 2026 13:27
@ghostwriternr ghostwriternr merged commit 690fc96 into main Jan 14, 2026
4 checks passed
@ghostwriternr ghostwriternr deleted the changeset-release/main branch January 14, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant