Search forkrail

Search documentation, comparisons, and CLI commands.

Webhooks, email and notifications

Get told when a deployment fails, a budget is reached or an attack starts: in the dashboard’s bell, by email through your own provider, or as signed webhooks.

Events

EventWhen
deployment.createdA deployment starts.
deployment.succeededA deployment is ready.
deployment.errorA deployment failed.
deployment.canceledA deployment was canceled.
deployment.promotedProduction moved to a deployment.
deployment.rollbackProduction rolled back to a deployment.
budget.reachedSpend reached 50, 75 or 100% of a budget.
budget.raisedThe default team budget grew for next month.
spend.pausedA project was paused at its budget.
spend.fastA project spent over 10% of its monthly budget in an hour.
attack.detectedThe system mitigations are refusing an attack.
domain.certificate.renew.failedA custom domain’s certificate failed to renew.

Webhooks

  1. 1
    Add a webhook

    Team Settings → Webhooks (owners): an HTTPS URL, the events it wants, and all projects or chosen ones. Up to 20 per install.

  2. 2
    Keep the secret

    It’s shown once, when the webhook is made. Use it to check signatures.

  3. 3
    Send a test

    Send test event posts a webhook.test so you can check your endpoint.

Each event is one POST with Vercel’s body shape: { "id", "type", "createdAt", "payload", "region" }, where payload has the deployment, its links, its target and the project. Check the x-forkrail-signature header, the hex HMAC-SHA1 of the raw body with your secret:

api/forkrail-webhook.ts
import crypto from 'node:crypto'
export async function POST(request: Request) {
const body = await request.text()
const expected = crypto.createHmac('sha1', process.env.WEBHOOK_SECRET!).update(body).digest('hex')
const given = request.headers.get('x-forkrail-signature') ?? ''
if (given.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))) {
return new Response('bad signature', { status: 401 })
}
const event = JSON.parse(body)
console.log(event.type, event.payload.deployment?.url)
return new Response('ok')
}
  • An answer other than 2xx within 30 seconds is retried after 1, 5 and 15 minutes, then 1, 2, 4, 8 and 12 hours, for up to a day. Each try is listed with the webhook for 30 days.
  • x-forkrail-event names the event and x-forkrail-delivery the try.
  • Webhooks reach public addresses only, and redirects aren’t followed.

Email

Email is off until an owner sets it up under team Settings → Email. It goes through your own provider; forkrail sends nothing itself.

ProviderSetup
Amazon SESIn your install’s account. The dashboard can add the From domain and lists its three DKIM records for your DNS. A new AWS account starts in SES’s sandbox (mail reaches only verified addresses) until you request production access in the SES console.
SMTPAny other provider (Resend, Postmark, SendGrid, Mailgun, Google Workspace, your own server): host, port 587 (STARTTLS) or 465 (TLS), user name and password. Port 25 is blocked by Lambda.

Send test email shows what the provider answered. SES costs $0.10 per 1,000 emails.

The bell, and who hears what

  • A failed deployment goes to whoever made it, if they’re a member (the GitHub user who pushed or who pressed the button), else to the owners.
  • A certificate renewal failure, an attack and budget alerts go to the owners.
  • Each person chooses, under My notifications, which kinds reach their bell and their email, and confirms their email address there.
  • Notifications are kept for a year.
New to forkrail? Install it in your AWS account and deploy your first app in about 20 minutes.
Quickstart