Skip to Content

Vercel

The Vercel integration connects your projects to TinyOps, enabling rules that monitor deployment status, track billing and usage metrics, and trigger automated rollbacks or redeployments when thresholds are breached.

Setup

Generate an API Token

Go to your Vercel dashboard. Navigate to Account Settings, then Tokens. Click Create Token, give it a descriptive name like “TinyOps Integration”, and copy the token value.

Add the Integration in TinyOps

Open TinyOps and go to Settings then Integrations. Click Add Integration and select Vercel.

Enter Your API Token

Paste the API token you generated in the previous step. TinyOps will verify the token has the required permissions and fetch your project list.

Select Projects

Choose which Vercel projects TinyOps should monitor. You can change this selection later from the integration settings page.

Verify Connection

Confirm the integration status shows Connected. You will see your projects listed with their latest deployment status.

Available Checks

NameReturn TypeDescription
billing.mtdnumberMonth-to-date spend in USD
billing.projectednumberProjected monthly spend in USD based on current usage
deployment.statusstringLatest deployment status (e.g. READY, ERROR, BUILDING)
deployment.domainstringURL of the latest production deployment
usage.bandwidthnumberBandwidth consumed in GB for the current billing period
usage.serverless_invocationsnumberTotal serverless function invocations for the current period

Available Actions

MethodParamsDescription
redeployproject (string, optional)Triggers a new deployment from the latest commit. Defaults to the project in context if omitted.
rollbackproject (string, required)Rolls back to the previous successful deployment for the specified project.

Example Rules

Cost Spike Alert

Notify when projected monthly costs exceed your budget threshold.

cost-spike-alert.yaml
name: Vercel Cost Spike Alert trigger: schedule: "0 8 * * *" provider: vercel conditions: - check: billing.projected operator: gt value: 50 actions: - method: notify provider: slack params: channel: "#engineering" message: "Vercel projected spend is ${{billing.projected}} this month (budget: $50). Current MTD: ${{billing.mtd}}."

Auto-Rollback on Failed Deploy

Automatically roll back when a deployment enters an error state.

auto-rollback.yaml
name: Auto-Rollback on Failed Deploy trigger: event: deployment.status_changed provider: vercel conditions: - check: deployment.status operator: eq value: ERROR actions: - method: rollback params: project: "tinyops-web" - method: notify provider: email params: to: "team@tinyops.cc" subject: "Vercel deploy failed — auto-rollback triggered" body: "The latest deployment for tinyops-web failed and has been rolled back to the previous version."

Bandwidth Usage Warning

Alert when bandwidth consumption approaches your plan limit.

bandwidth-warning.yaml
name: Bandwidth Usage Warning trigger: schedule: "0 12 * * *" provider: vercel conditions: - check: usage.bandwidth operator: gt value: 90 actions: - method: notify provider: slack params: channel: "#infra" message: "Vercel bandwidth usage is at {{usage.bandwidth}} GB. Review traffic patterns or upgrade your plan."

Troubleshooting

Common issues:

  • Invalid token error: Ensure the token has not expired and has the correct scope. Tokens with “Read Only” access cannot trigger rollbacks or redeployments.
  • Project not appearing: Only projects the token owner has access to will be listed. Verify you are using a token from an account that owns or has been invited to the project.
  • Billing data showing zero: Billing checks require the token to belong to the team owner or an admin. Member-level tokens may not have billing visibility.
  • Rollback not working: Rollback requires at least one previous successful deployment to exist. If the project has only one deployment, the action will fail gracefully.