ComputeTerminal

preview()

terminal.preview() → Promise<string|null>

Get the current URL for a published terminal port.

Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const url = await terminal.preview();
if (url) console.log("Open preview:", url);
url = terminal.preview()
if url:
    print("Open preview:", url)

Returns the URL, or null if no preview address is available. A preview URL may carry a short-lived access ticket; treat it as a credential and do not log or publish it.