A Vercel Edge Function that analyzes your notifications, picks the most fitting Sopranos character based on the message's sentiment, rewrites them in that character's voice, and posts them to Discord with matching GIFs.
- Analyzes message sentiment via Claude Sonnet to pick the best-matching character:
- Tony Soprano — authority, power, leadership issues
- Paulie Walnuts — paranoia, suspicion, conspiracy
- Christopher Moltisanti — drama, existential crises, creative problems
- Silvio Dante — strategic issues, loyalty, being pulled back into things
- Uncle Junior — disrespect, old-school gripes, health complaints
- Bobby Baccalieri — gentle problems, food, wholesome concerns
- Rewrites the message in that character's voice via LLM
- Searches Tenor for relevant Sopranos GIFs based on character and message severity
- Posts to Discord webhooks with character avatars and embedded GIFs
- Severity-based color coding (critical=red, error=light red, warning=orange, info=blue)
- Falls back to random character selection if no API key is configured
Analyze a notification's sentiment, pick the best-matching Sopranos character, rewrite the message in their voice, and post to Discord.
Headers:
x-saas-destination(required): Discord webhook URL
Body (JSON):
{
"message": "Server CPU usage at 95%",
"source": "monitoring-system",
"severity": "critical"
}Fields:
message(required): The notification message to rewritesource(optional): Source of the notification (shown in embed footer)severity(optional): One ofinfo,warning,error,critical
Example Request:
curl -X POST https://your-deployment.vercel.app/api/notify \
-H "Content-Type: application/json" \
-H "x-saas-destination: https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN" \
-d '{
"message": "Database connection pool exhausted",
"source": "postgres-monitor",
"severity": "error"
}'Response:
{
"success": true,
"character": "Tony Soprano",
"originalMessage": "Database connection pool exhausted",
"rewrittenMessage": "Whaddya gonna do? The database connections are all used up. It's like the garbage business - sometimes you run outta trucks.",
"gifUrl": "https://media.tenor.com/..."
}Set these in your Vercel project settings:
| Variable | Required | Description |
|---|---|---|
OPENROUTER_API_KEY |
No | API key from OpenRouter. Without it, character selection is random and messages get a catchphrase prefix instead of a full rewrite. |
TENOR_API_KEY |
No | API key from Tenor. Has public fallback. |
- Install Vercel CLI:
npm i -g vercel - Clone this repository
- Run
vercelto deploy - Set environment variables in Vercel dashboard
npm install
cp .env.example .env.local
# Edit .env.local with your API keys
npm run dev- Go to your Discord server settings
- Navigate to Integrations > Webhooks
- Click "New Webhook"
- Copy the webhook URL
- Use it in the
x-saas-destinationheader
MIT
