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:
/vercel/webhookWhat 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
| Input | Required | Description |
|---|---|---|
gitOwner | yes | Repository owner, organization, or username (e.g. my-org). |
gitRepo | yes | Repository name to deploy (e.g. my-app). |
vercelToken | yes | A Vercel API token with deploy access. Accepts a {{env.KEY}} reference to keep the secret out of the canvas. |
gitProvider | optional | Git host: github (default), gitlab, or bitbucket. |
gitBranch | optional | Branch to deploy. Defaults to main. |
target | optional | Vercel target: production (default) or preview. |
projectName | optional | Vercel project name. Defaults to the repository name. |
vercelTeamId | optional | Vercel team/scope id the project belongs to. |
framework, rootDirectory, buildCommand, installCommand, outputDirectory, nodeVersion | optional | Build 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 onDEPLOYMENT_DELETED, onDEPLOYMENT_STATUS_CHANGEDtoSTOPPED, and to reap the previous deployment after aDEPLOYMENT_ENV_CHANGEDredeploy.
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 emitsDEPLOYMENT_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 becomesSTOPPED, remove the deployment from Vercel.HEALTH_CHECK— confirm the hosted deployment is reachable.
Configuration
The service calls back into the API atDREAMBASE_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.