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
| Name | Return Type | Description |
|---|---|---|
billing.mtd | number | Month-to-date spend in USD |
billing.projected | number | Projected monthly spend in USD based on current usage |
deployment.status | string | Latest deployment status (e.g. READY, ERROR, BUILDING) |
deployment.domain | string | URL of the latest production deployment |
usage.bandwidth | number | Bandwidth consumed in GB for the current billing period |
usage.serverless_invocations | number | Total serverless function invocations for the current period |
Available Actions
| Method | Params | Description |
|---|---|---|
redeploy | project (string, optional) | Triggers a new deployment from the latest commit. Defaults to the project in context if omitted. |
rollback | project (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.
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.
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.
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.