Skip to content

Preview

Every sandbox+port can get a public URL that routes to the sandbox's API endpoint.

Services running inside the sandbox are not reachable publicly by default. Call exposePort to add a port to the allowlist and create a public route for it.

const exposure = await sandbox.exposePort(3000)
console.log(exposure.url) // https://<sandbox-id>-3000.sandbox.example.com

Remove the public route and the port from the allowlist.

await sandbox.unexposePort(3000)

See Port Allowlist for full details on how port access control works.

TLS certificates are issued automatically:

  • Domain mode (SB_DOMAIN set): Caddy issues a single wildcard certificate covering <domain> and *.<domain> via DNS-01 (Cloudflare). The installer requires --dns-provider whenever --domain is set - see Server Setup.
  • IP mode (no SB_DOMAIN): Routes are HTTP-only, no TLS.