Skip to content

Instantly share code, notes, and snippets.

View Maxservais's full-sized avatar

Maxime Servais Maxservais

View GitHub Profile
@borispoehland
borispoehland / pause_all.ts
Last active June 8, 2024 13:44
Vercel Webhook to call to pause the project after the spending limit is reached
import crypto from 'crypto'
const { INTEGRATION_SECRET, VERCEL_TEAM_ID, VERCEL_TOKEN } = process.env
function sha1(data: Buffer, secret: string): string {
return crypto.createHmac('sha1', secret).update(data).digest('hex')
}
export async function POST(request: Request) {
if (typeof INTEGRATION_SECRET != 'string') {