Skip to content

Vercel Deploys

The vercel-deploys plugin monitors Vercel deployments across multiple projects. It tracks deployment state changes (queued, building, ready, error, canceled), captures git metadata (commit SHA, branch, author), and correlates deployment activity with other observations to help identify deployment-related incidents.

import { createAgent } from 'zupdev';
import { vercelDeploys } from 'zupdev/plugins/vercel-deploys';
const agent = await createAgent({
name: 'vercel-agent',
plugins: [
vercelDeploys({
auth: { token: process.env.VERCEL_TOKEN! },
projects: [
{
id: 'prj_abc123',
serviceName: 'Marketing Site',
},
],
}),
],
});

A Vercel Personal Access Token (PAT) is required. Generate one from the Vercel dashboard under Account Settings > Tokens.

FieldTypeDefaultDescription
authVercelAuthConfigRequired. Authentication configuration.
auth.tokenstringRequired. Vercel Personal Access Token.
projectsVercelProjectConfig[]Required. Projects to monitor. At least one project must be configured.
pollIntervalMsnumber60000Polling interval in milliseconds.
maxDeploysPerProjectnumber20Maximum deployments to fetch per project per poll.
apiBaseUrlstring'https://api.vercel.com'Vercel API base URL.

Each project describes a Vercel project to monitor:

FieldTypeRequiredDescription
idstringYesVercel project ID (e.g., 'prj_xyz') or project name.
serviceNamestringYesHuman-readable service name for SRE context (used in observations and findings).
teamIdstringNoTeam ID for team-scoped projects.
environmentsArray<'production' | 'preview' | 'development'>NoEnvironments to monitor. Defaults to all environments.

The observer polls the Vercel Deployments API for each configured project and produces observations:

Deployment events (vercel-deploys/deployment): One observation per deployment with:

  • Deployment ID, project name, service name, environment, and state
  • Deployment URL and inspector URL
  • Git metadata: commit SHA, message, branch, author, repository URL
  • Creator information (user who triggered the deployment)
  • Error code and message (for failed deployments)
  • Time since the previous deployment
  • Severity: critical for failed production deployments, error for failed non-production deployments, info for all others

API errors (vercel-deploys/error): Emitted when the Vercel API call fails for a project, with warning severity.

The observer fetches incrementally — after the first poll, it only fetches deployments created after the most recent one seen.

Analyzes Vercel deployment observations grouped by service:

  • Reports the most recent production deployment with its state, time since deployment, commit SHA, and author
  • Counts failed deployments per service. When 3 or more failures are detected, sets contributingFactor to indicate a possible build or configuration issue
  • Reports deployments currently in progress (building or queued)
  • Confidence: 0.85

All endpoints require authentication by default.

Lists all configured Vercel projects with their latest deployment status.

Response:

{
"projects": [
{
"id": "prj_abc123",
"serviceName": "Marketing Site",
"teamId": "team_xyz",
"environments": ["production"],
"lastFetchTime": "2025-06-15T10:30:00.000Z",
"lastDeployment": {
"uid": "dpl_abc123",
"state": "READY",
"target": "production",
"url": "marketing-site-abc123.vercel.app",
"createdAt": "2025-06-15T10:25:00.000Z",
"git": {
"commitSha": "a1b2c3d",
"commitMessage": "Update hero section",
"branch": "main",
"author": "alice"
}
},
"recentDeploymentCount": 8
}
]
}

GET /vercel/projects/:projectId/deployments

Section titled “GET /vercel/projects/:projectId/deployments”

Returns recent deployments for a specific project with full details.

Response:

{
"project": {
"id": "prj_abc123",
"serviceName": "Marketing Site"
},
"deployments": [
{
"uid": "dpl_abc123",
"projectId": "prj_abc123",
"projectName": "marketing-site",
"state": "READY",
"target": "production",
"url": "marketing-site-abc123.vercel.app",
"inspectorUrl": "https://vercel.com/team/marketing-site/dpl_abc123",
"createdAt": "2025-06-15T10:25:00.000Z",
"readyAt": "2025-06-15T10:26:30.000Z",
"git": {
"commitSha": "a1b2c3d4e5f6",
"commitMessage": "Update hero section",
"branch": "main",
"author": "alice",
"repoUrl": "https://github.com/myorg/marketing-site"
},
"creator": {
"uid": "user_abc",
"email": "alice@example.com",
"username": "alice"
},
"error": null
}
],
"lastFetchTime": "2025-06-15T10:30:00.000Z"
}

The plugin tracks these Vercel deployment states:

StateDescription
QUEUEDDeployment is queued, waiting to build
BUILDINGDeployment is currently building
READYDeployment completed successfully
ERRORDeployment failed with an error
CANCELEDDeployment was canceled
INITIALIZINGDeployment is initializing
import { createAgent } from 'zupdev';
import { vercelDeploys } from 'zupdev/plugins/vercel-deploys';
const agent = await createAgent({
name: 'vercel-monitor',
mode: 'continuous',
loopInterval: 30000,
api: {
port: 3000,
auth: {
apiKeys: [{ key: process.env.API_KEY!, name: 'admin' }],
},
},
plugins: [
vercelDeploys({
auth: { token: process.env.VERCEL_TOKEN! },
pollIntervalMs: 60000,
maxDeploysPerProject: 20,
projects: [
{
id: 'prj_frontend',
serviceName: 'Frontend App',
teamId: 'team_myorg',
environments: ['production'],
},
{
id: 'prj_docs',
serviceName: 'Documentation Site',
teamId: 'team_myorg',
environments: ['production', 'preview'],
},
{
id: 'prj_api',
serviceName: 'API Functions',
teamId: 'team_myorg',
},
],
}),
],
});
const server = agent.startApi({ port: 3000 });
await agent.start();

Three Vercel projects are monitored, each with a descriptive service name for SRE context. The Frontend App tracks production only. The Documentation Site includes preview deployments. The API Functions project monitors all environments. Deployment failures in production trigger critical severity observations. Git metadata (commit SHA, branch, author) is captured with each deployment for incident correlation.