Share links
Show a server running in a sandbox to someone without an API key: a time-bounded, optionally single-use link you can revoke, from one command.
A sandbox port is private by default: its preview URL needs your API key (or a short-lived access token). A share link is for a person without a key: they open it in a browser and see the port, until the link expires or you revoke it.
sandal exec <sandbox> --detach -- python3 -m http.server 8000
sandal share <sandbox> 8000 # a link for one hour
sandal share <sandbox> 8000 --ttl 30m --single-usehttps://api.sandal.dev/v1/share/…
exposure: sandbox-port.1dd6…
expires: 2026-11-27T04:50:29.349Z
share-link: shl_ed74…sandal share exposes the port first if it is not exposed yet (the same as sandal ports expose <sandbox> <port> --share), then prints the link.
| Option | Meaning |
|---|---|
--ttl | Link lifetime, 1 minute to 24 hours (default 1 hour), never longer than the port exposure |
--single-use | Only the first person who confirms the link gets in |
--protocol tcp | For TCP ports (and servers without share links) you get a one-browser token link instead (?sandal_token=, at most 1 hour) |
List and revoke#
sandal share ls <sandbox> <exposure> # ID, STATE, USE, OPENS, LAST OPENED, EXPIRES
sandal share revoke <sandbox> <exposure> <share-link> # the link answers 410 Gone from now on
sandal share token <sandbox> <exposure> # a one-browser link with an access tokenRevoking a link stops new visits within seconds. A browser that already opened it keeps its session until that session ends, which can take up to an hour. To cut off people who already opened the link, revoke the port exposure (sandal ports revoke): that ends every session at once.
From the SDKs#
share(port) exposes the port and returns the link (url), in TypeScript sb.share(8000), Python await sb.share(8000) and Go sb.Share(ctx, 8000, sandal.SandalExposeOptions{}); the quickstart runs all three.
Limits today#
- Links last at most 24 hours; there are no permanent public ports and no custom domains yet.
- A link opens HTTP ports in a browser. API clients should use the private preview URL with the API key instead.