App Hosting service

Vercel

The Vercel integration deploys an app from a git source — such as a GitHub repository — to Vercel, polls the deployment to completion, then reports the live deployment URL and status back to Dreambase.

Vercel is the reference provider of the App Hosting service. It handles its own webhook route:

POST/vercel/webhook
Deploy & manage a git-sourced app on Vercel

What it does

On DEPLOYMENT_CREATEDthe service takes the project's git source, creates a deployment on Vercel (setting the environment variables Dreambase resolved for the deployment, including any injected by connected dependencies), and polls it to completion before reporting the live url back to the Dreambase API. On DEPLOYMENT_DELETED it tears the deployment down using the stored deployment id.

Because Vercel deployments are immutable, changes are applied by redeploying. On DEPLOYMENT_ENV_CHANGED the service creates a fresh deployment carrying the new environment variables and, once it is live, tears down the deployment it replaced. On DEPLOYMENT_STATUS_CHANGED it reconciles the hosted resource with the new status — when a deployment becomes STOPPED(for instance, superseded by a newer one), the Vercel deployment is removed, since Vercel has no way to pause an individual deployment.

Inputs

InputRequiredDescription
gitOwneryesRepository owner, organization, or username (e.g. my-org).
gitRepoyesRepository name to deploy (e.g. my-app).
vercelTokenyesA Vercel API token with deploy access. Accepts a {{env.KEY}} reference to keep the secret out of the canvas.
gitProvideroptionalGit host: github (default), gitlab, or bitbucket.
gitBranchoptionalBranch to deploy. Defaults to main.
targetoptionalVercel target: production (default) or preview.
projectNameoptionalVercel project name. Defaults to the repository name.
vercelTeamIdoptionalVercel team/scope id the project belongs to.
framework, rootDirectory, buildCommand, installCommand, outputDirectory, nodeVersionoptionalBuild overrides. Leave empty to let Vercel auto-detect.

Outputs

  • url — the live URL of the Vercel deployment.
  • vercelDeploymentId — the deployment's id on Vercel, used to tear it down on DEPLOYMENT_DELETED, on DEPLOYMENT_STATUS_CHANGED to STOPPED, and to reap the previous deployment after a DEPLOYMENT_ENV_CHANGED redeploy.

Environment variables flow through

Outputs from services this app depends on — a database connection string, an API key — are mapped to environment variables by the connector between them. They are seeded onto the deployment when it is created and set on Vercel during deployment, so your hosted app comes up already wired to the rest of the project. If a dependency later publishes new outputs, Dreambase emits DEPLOYMENT_ENV_CHANGED and the service redeploys with the updated values.

Events it handles

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • DEPLOYMENT_CREATED — create a deployment from the git source (with its environment variables) and report its URL and status.
  • DEPLOYMENT_DELETED — remove the deployment from Vercel.
  • DEPLOYMENT_ENV_CHANGED — redeploy with the updated environment variables, then tear down the previous deployment.
  • DEPLOYMENT_STATUS_CHANGED — reconcile the hosted resource; when the status becomes STOPPED, remove the deployment from Vercel.
  • HEALTH_CHECK — confirm the hosted deployment is reachable.

Configuration

The service calls back into the API at DREAMBASE_API_URL (default http://localhost:3005) and talks to Vercel at VERCEL_API_URL (default https://api.vercel.com). It runs on PORT 3007 locally.