AppPreviewSession

The `AppPreviewSession` entity.

Definition

TypeScript
interface AppPreviewSession {
  id: string;
  workspaceId: string;
  appId: string;
  versionId: string;
  status:
    | "failed"
    | "hydrating"
    | "installing"
    | "starting"
    | "ready"
    | "stopped";
  previewUrl: string | null;
  error: string | null;
  metadata: Record<string, unknown> | null;
  lastHeartbeatAt: string;
  createdBy: string | null;
  startedAt: string | null;
  readyAt: string | null;
  stoppedAt: string | null;
  createdAt: string;
}

Fields

FieldTypeNotes
idstringreadonly required
workspaceIdstringrequired — Workspace that owns the previewed app.
appIdstringrequired — App being previewed.
versionIdstringrequired — App version running inside the preview sandbox.
status"failed" | "hydrating" | "installing" | "starting" | "ready" | "stopped"required — Sandbox lifecycle: hydrating → installing → starting → ready; terminal 'failed'/'stopped'.
previewUrlstring | nullrequired — Public preview URL once the sandbox is ready.
errorstring | nullrequired — Error message when status is 'failed', otherwise null.
metadataRecord<string, unknown> | nullrequired — Free-form sandbox metadata (container id, ports, etc.).
lastHeartbeatAtstringrequired — ISO-8601 timestamp of the last keep-alive ping from the sandbox.
createdBystring | nullrequired — User who started the preview; null for system-initiated sessions.
startedAtstring | nullrequired — ISO-8601 timestamp when the sandbox boot began.
readyAtstring | nullrequired — ISO-8601 timestamp when the preview URL first became reachable.
stoppedAtstring | nullrequired — ISO-8601 timestamp when the sandbox was torn down.
createdAtstringreadonly required — ISO-8601 timestamp of creation.