Public
Like
1
vercelAlertToDiscord
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v5View latest version
A simple webhook handler that receives Vercel alerts and posts them as formatted messages to a Discord channel.
-
Environment Variable: Set
DISCORD_WEBHOOK_URL
to your Discord webhook URL- In Discord: Server Settings → Integrations → Webhooks → Create Webhook
- Copy the webhook URL and add it as an environment variable
-
Vercel Configuration:
- Go to your Vercel project settings
- Navigate to Webhooks section
- Add this Val's HTTP endpoint as a webhook URL
- Select the events you want to monitor (e.g., deployment alerts, usage anomalies)
- ✅ Handles Vercel webhook payloads
- ✅ Formats alerts as Discord embeds with proper colors
- ✅ Includes project info, timestamps, and links
- ✅ Different colors for different alert types:
- 🟡 Yellow for usage anomalies and warnings
- 🔴 Red for errors and failures
- 🔵 Blue for general alerts
- ✅ Clickable links to Vercel observability dashboard
usage_anomaly
- Unusual usage patternsobservability.anomaly
- Observability alerts- And other Vercel alert types
The webhook will create rich Discord embeds with:
- Alert type and emoji
- Project and team information
- Timestamp (formatted as Discord timestamp)
- Direct link to Vercel dashboard
- Color-coded based on severity