Documentation Index
Fetch the complete documentation index at: https://bobprince.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Hookdrop can generate working code directly from a captured event — a TypeScript interface for your types, or a complete handler ready to drop into your codebase.
TypeScript interface
Generate a typed TypeScript interface from the shape of any captured event payload.
GET /api/endpoints/:id/events/:eventId/ai/schema
Authorization: Bearer YOUR_API_TOKEN
Example response
{
"schema": "interface PaystackChargeSuccessEvent {\n event: string;\n data: {\n id: number;\n status: string;\n reference: string;\n amount: number;\n currency: string;\n customer: {\n email: string;\n name: string;\n };\n };\n}"
}
Handler code
Generate a complete webhook handler in your preferred language and framework. The generated handler includes HMAC signature verification, error handling, and logic based on the event type.
POST /api/endpoints/:id/events/:eventId/ai/handler
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
Request body
{
"language": "typescript",
"framework": "express"
}
Example response
{
"handler": "import { Request, Response } from 'express';\nimport crypto from 'crypto';\n\nexport function handleWebhook(req: Request, res: Response) {\n const signature = req.headers['x-paystack-signature'] as string;\n const hash = crypto.createHmac('sha512', process.env.PAYSTACK_SECRET!)\n .update(JSON.stringify(req.body))\n .digest('hex');\n\n if (hash !== signature) {\n return res.status(401).json({ error: 'Invalid signature' });\n }\n\n const event = req.body;\n\n if (event.event === 'charge.success') {\n // Handle successful charge\n console.log(`Payment of ${event.data.amount} received from ${event.data.customer.email}`);\n }\n\n res.status(200).json({ received: true });\n}"
}
Copy the generated handler directly into your codebase as a starting point. Review the signature verification secret and swap in your own environment variable names before deploying.
Supported languages
| Language | Value |
|---|
| TypeScript | typescript |
| JavaScript | javascript |
| Python | python |
| Go | go |
Supported frameworks
| Framework | Value |
|---|
| Express | express |
| Fastify | fastify |
| Next.js | nextjs |
| FastAPI | fastapi |
| Gin | gin |