Skip to main content
Labs preview. Artifacts are not part of the stable Durable Sessions API. Large event bodies can already spill to a content_ref.
Artifacts are session outputs your UI can load later: files, links, reports, and preview URLs. A preview points to a process running in the session machine, such as a dev server or built app.

Artifact kinds

  • file / link: snapshotted to storage at publish; fetchable after the machine is gone.
  • preview: a durable entry for a live URL into the session machine. The served app depends on machine state, so it carries a status (live / cold).

Publish from the runtime

The runtime publishes artifacts through two tools:
  • oc.preview(port) — expose a port of the session’s machine as a preview URL.
  • oc.publish(path) — snapshot a file as a durable artifact.
Each publish appends a user-level event and upserts the artifact, so it reaches your UI as soon as it’s produced.

Read artifacts in your app

Use the same snapshot-plus-stream pattern as events: list on load, subscribe for changes.
A preview URL is a public capability — the browser loads it directly; a client token only gates learning the URL (via the user-level event), so you can stream the whole build and embed the running app from the same front-end.