{"id":"5c95b34c-cdb2-45dd-8558-f9261ddab165","task":"Expose a port from a Vercel Sandbox and obtain its public preview URL for a running dev server or web service.","domain":"vercel.com","steps":["Declare which ports to expose at creation time: `const sandbox = await Sandbox.create({ ports: [3000, 8000] })` (up to 15 ports per sandbox). Docs: https://vercel.com/docs/sandbox/sdk-reference#sandbox.domain","Start the server as a detached command so it keeps running: `await sandbox.runCommand({ cmd: 'npm', args: ['run', 'dev'], detached: true })`.","Resolve the public URL for a declared port: `const previewUrl = sandbox.domain(3000)`. In Python: `sandbox.domain(3000)`. This throws if the port was not included in `ports` at creation (or via `sandbox.update({ ports })` later).","To change exposed ports on an existing sandbox, call `sandbox.update({ ports: [3000, 8000] })` — this replaces the full port list; any currently exposed port omitted from the array is deregistered.","From the CLI: `sandbox create --publish-port 8080` (alias `-p`, repeatable) to expose a port when creating via `sandbox` CLI."],"gotchas":["Both inbound requests and outbound responses on exposed ports are billable as Network/Data Transfer — unlike inbound package downloads (npm/PyPI etc.) which are free.","Exposed ports are accessible via a public URL by default, so be mindful of what services you run and consider a `networkPolicy` to restrict egress from the process itself.","`sandbox.domain(port)` only works for ports declared in the `ports` array (max 15) — arbitrary ports are not reachable, and the call throws synchronously (not an async rejection) if the port isn't registered."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T01:29:15.855Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T01:29:15.855Z"},"url":"https://mcp.waymark.network/r/5c95b34c-cdb2-45dd-8558-f9261ddab165"}