Skip to main content

Version Channels

Stage apps support deployment channels that control which version of your app is served in each environment. Channels let you promote tested versions from preview to production and roll back if needed.

Channel Model

Each app can have two channels:

ChannelPurpose
previewLatest development version, used for testing and review
productionStable version served to end users

A channel record pins a specific app version to an environment. When you deploy, the preview channel is updated automatically. Production requires an explicit promotion step.

App settings page with metadata, repository link, and status controls

Data Model

interface AppChannel {
appSid: string; // Parent app ID
channel: "preview" | "production";
appVersionSid: string; // Pinned version ID
sessionId: string; // Session backing this version
branch?: string; // Git branch at deploy time
commitSha?: string; // Git commit at deploy time
updatedByEmail: string; // Who last updated this channel
updatedAt: number; // Unix timestamp (ms)
}

Version Sources

Versions can originate from different workflows:

SourceDescription
publishInitial app publication
studio_deployDeploy from Studio session
feedbackIteration based on user feedback
promotionPromoted from another channel

Workflow

Studio Deploy → preview channel → (promote) → production channel
↑ ↓
rollback ←─────────────────── rollback
  1. Deploy — Push files and trigger render. The preview channel auto-updates.
  2. Test — Validate via the preview URL or delegated agent tests.
  3. Promote — Move the preview version to production.
  4. Rollback — Revert production to a previous version if needed.

Convex Operations

OperationFunctionDescription
Get channelstage:getResolvedAppChannelRetrieve channel record with linked version details
Upsert channelstage:upsertAppChannelCreate or update a channel with a new version
Get summarystage:getAppChannelsForSummaryFetch both channels for an app in parallel

Channel-Scoped Configuration

Each channel maintains its own:

  • OAuth configuration — Scopes and client settings can differ between preview and production
  • Session binding — Each channel points to a specific session with its own file state
  • Git tracking — Branch and commit SHA recorded at deploy time for traceability

Storage

Channel records are stored in the stage_app_channels Convex table with a composite index on (appSid, channel) for fast lookups.