Skip to content

feat(triggers): add Vercel webhook triggers with automatic registration - #3988

Merged
waleedlatif1 merged 5 commits into
stagingfrom
waleedlatif1/add-vercel-trigger
Apr 6, 2026
Merged

feat(triggers): add Vercel webhook triggers with automatic registration#3988
waleedlatif1 merged 5 commits into
stagingfrom
waleedlatif1/add-vercel-trigger

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add 8 Vercel webhook triggers: deployment created/ready/error/canceled, project created/removed, domain created, and generic webhook (all events)
  • Automatic webhook registration via Vercel REST API (POST /v1/webhooks) with Bearer token auth
  • Automatic cleanup on trigger removal (DELETE /v1/webhooks/{id})
  • Supports optional team ID scoping and project ID filtering
  • Webhook input formatting extracts deployment, project, team, user, target, plan, and domain from Vercel's envelope payload

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor

cursorBot commented Apr 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Adds a new webhook provider with HMAC verification and automatic subscription creation/deletion via Vercel’s API; issues here could cause missed/extra webhook deliveries or leaked/misused credentials if misconfigured.

Overview
Adds Vercel webhook trigger support: registers 8 new Vercel triggers (deployment created/ready/error/canceled, project created/removed, domain created, and a generic vercel_webhook) in TRIGGER_REGISTRY and exposes them from the Vercel block via triggers.available and injected trigger subBlocks.

Introduces a new vercel webhook provider handler that auto-creates and deletes Vercel webhook subscriptions (scoped by optional teamId and projectIds filters), verifies incoming requests using x-vercel-signature HMAC, and normalizes incoming payloads into consistent trigger inputs.

Reviewed by Cursor Bugbot for commit ee040aa. Configure here.

@vercel

vercelBot commented Apr 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedApr 6, 2026 7:20pm

Request Review

@greptile-apps

greptile-appsBot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds 8 Vercel webhook triggers (deployment created/ready/error/canceled, project created/removed, domain created, and a generic all-events trigger) with automatic webhook lifecycle management — registration on trigger save and cleanup on trigger removal. The implementation closely follows established provider patterns from Ashby, Attio, and others: HMAC-SHA1 signature verification via createHmacVerifier, providerConfigUpdates for persisting externalId + webhookSecret, and formatInput to normalize Vercel's envelope payload into typed workflow inputs.

  • Previously flagged critical issues (discarded webhookSecret, missing verifyAuth) have been properly resolved
  • verifyAuth is correctly implemented using HMAC-SHA1 via the x-vercel-signature header and the createHmacVerifier factory
  • createSubscription stores both externalId and webhookSecret in providerConfigUpdates
  • deleteSubscription handles 404 gracefully (Vercel may have already cleaned up the webhook)
  • formatInput extracts all relevant fields from Vercel's webhook envelope (deployment, project, team, user, target, plan, domain)
  • All 8 triggers are registered in both triggers/registry.ts and lib/webhooks/providers/registry.ts; the Vercel block's triggers.available is updated accordingly
  • Two minor P2 items remain: (1) webhookSecret falls back to '' rather than throwing when absent, silently bypassing HMAC auth; (2) the non-ok path in deleteSubscription doesn't consume the response body

Confidence Score: 5/5

Safe to merge — the integration is functionally complete, all prior critical issues are resolved, and remaining findings are minor defensive-coding suggestions

All remaining findings are P2. HMAC auth, auto-registration, and cleanup are correctly implemented following the codebase's established provider patterns. The empty-string secret fallback is the only item worth addressing before shipping but does not block merge.

apps/sim/lib/webhooks/providers/vercel.ts — the webhookSecret empty-string fallback on lines 150–155 and the unconsumed response body on lines 192–199 are the only items to address

Important Files Changed

FilenameOverview
apps/sim/lib/webhooks/providers/vercel.tsCore Vercel webhook provider: HMAC-SHA1 verifyAuth, auto-registration via POST /v1/webhooks, cleanup via DELETE — webhookSecret falls back to empty string if absent from API response
apps/sim/lib/webhooks/providers/registry.tsRegisters vercelHandler in PROVIDER_HANDLERS map under the 'vercel' key
apps/sim/triggers/vercel/utils.tsShared Vercel trigger utilities: trigger options dropdown, setup instructions HTML, extra form fields (apiKey with user-only visibility, optional teamId and filterProjectIds), and typed output builders
apps/sim/triggers/vercel/webhook.tsGeneric Vercel webhook trigger subscribing to all supported event types
apps/sim/triggers/vercel/deployment_created.tsDeployment Created trigger — primary trigger with dropdown for selecting event type
apps/sim/triggers/vercel/deployment_ready.tsDeployment Ready trigger config using shared deployment outputs
apps/sim/triggers/vercel/deployment_error.tsDeployment Error trigger config using shared deployment outputs
apps/sim/triggers/vercel/deployment_canceled.tsDeployment Canceled trigger config using shared deployment outputs
apps/sim/triggers/vercel/project_created.tsProject Created trigger config using shared project outputs
apps/sim/triggers/vercel/project_removed.tsProject Removed trigger config using shared project outputs
apps/sim/triggers/vercel/domain_created.tsDomain Created trigger config using shared domain outputs
apps/sim/triggers/vercel/index.tsBarrel export for all 8 Vercel trigger configs
apps/sim/triggers/registry.tsAll 8 Vercel triggers correctly registered in TRIGGER_REGISTRY
apps/sim/blocks/blocks/vercel.tsVercel block updated to expose all 8 webhook triggers in triggers.available

Sequence Diagram

sequenceDiagram
actor User
participant Sim
participant VercelAPI as Vercel API
participant VercelEvents as Vercel Event System
User->>Sim: Configure trigger (apiKey, teamId, projectIds)
Sim->>VercelAPI: POST /v1/webhooks (events, url, projectIds)
VercelAPI-->>Sim: { id: webhookId, secret: webhookSecret }
Sim->>Sim: Store externalId + webhookSecret in providerConfig
Note over Sim,VercelEvents: Later, when a Vercel event occurs...
VercelEvents->>Sim: POST /webhook-url (event payload + x-vercel-signature)
Sim->>Sim: Verify HMAC-SHA1 signature (webhookSecret + raw body)
alt Signature invalid
Sim-->>VercelEvents: 401 Unauthorized
else Signature valid
Sim->>Sim: Extract payload fields (deployment, project, team, domain...)
Sim->>Sim: Execute workflow with formatted input
Sim-->>VercelEvents: 200 OK
end
Loading

Reviews (6): Last reviewed commit: "fix(triggers): add paramVisibility user-..." | Re-trigger Greptile

Comment threadapps/sim/lib/webhooks/providers/vercel.ts Outdated
Comment threadapps/sim/lib/webhooks/providers/vercel.ts
Comment threadapps/sim/lib/webhooks/providers/vercel.ts Outdated
Comment threadapps/sim/lib/webhooks/providers/vercel.ts
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

Comment threadapps/sim/lib/webhooks/providers/vercel.ts
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

Comment threadapps/sim/lib/webhooks/providers/vercel.ts
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

Comment threadapps/sim/lib/webhooks/providers/vercel.ts
Comment threadapps/sim/lib/webhooks/providers/vercel.ts Outdated
…ck for Vercel webhooks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c637317. Configure here.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ee040aa. Configure here.

@waleedlatif1
waleedlatif1 merged commit 8b1d749 into stagingApr 6, 2026
12 checks passed
@waleedlatif1
waleedlatif1 deleted the waleedlatif1/add-vercel-trigger branch April 6, 2026 19:31
emir-karabeg pushed a commit that referenced this pull request Apr 7, 2026
…on (#3988)
* feat(triggers): add Vercel webhook triggers with automatic registration
* fix(triggers): add Vercel webhook signature verification and expand generic events
* fix(triggers): validate Vercel webhook ID before storing to prevent orphaned webhooks
* fix(triggers): add triggerId validation warning and JSON parse fallback for Vercel webhooks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(triggers): add paramVisibility user-only to Vercel apiKey subblock
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@waleedlatif1