Installation
Install Hookstack SDK in your project:Quick Setup
1. Configure Environment
First, set up your signing secret. This is used to verify incoming webhooks:2. Create Your First Webhook Handler
Next.js Route Handler
Next.js Route Handler
Express Handler
Express Handler
Hono Handler
Hono Handler
3. Configure Your Webhook URL
Create a new webhook in your Hookstack dashboard and copy the generated Webhook URL. Set up your webhook URL in your provider’s dashboard and ensure you’ve configured the signing secret correctly:Security Features
Hookstack provides robust security features out of the box:Signature Verification
Cryptographic verification of webhook signatures using HMAC-SHA256
Timestamp Validation
Protection against replay attacks with timestamp verification
Version Control
Support for multiple signature versions for seamless upgrades
Raw Body Handling
Proper handling of raw request bodies for signature verification
Next Steps
Security Guide
Learn about our security features and best practices
Advanced Usage
Custom handlers, middleware, and error handling
TypeScript Guide
Type definitions and payload interfaces
Best Practices
Production deployment and monitoring
Troubleshooting
Signature Verification Failed
Signature Verification Failed
Common causes of signature verification failures:
- Incorrect
HOOKSTACK_SIGNING_SECRET
- Modified request body (ensure raw body parsing)
- Missing or incorrect headers
- Clock drift between servers (check timestamp)
Express Body Parsing
Express Body Parsing
For Express applications, ensure you use Using
express.raw()
middleware:express.json()
will modify the request body and break signature verification.Handling Long Operations
Handling Long Operations
For time-intensive processing:
The Next.JS example provides a nice example of how to handle this when deploying to Vercel, using the
waitUntil()
async processing function.