A simple Next.js webhook listener for Bright Data unlock events, designed to run directly on Vercel.
- Go to vercel.com
- Click "New Project"
- Import your GitHub repository
- Click "Deploy"
- Fork or clone this repository to your GitHub account
- Connect your GitHub account to Vercel
- Import the repository from your Vercel dashboard
- Deploy automatically
Once deployed, your webhook endpoint will be:
https://your-project-name.vercel.app/api/webhook
curl -X POST https://your-project-name.vercel.app/api/webhook \
-H "Content-Type: application/json" \
-d '{"event": "unlock", "user_id": "123", "data": "test"}'
curl https://your-project-name.vercel.app/api/webhook
The webhook handler is located in app/api/webhook/route.js
. Add your custom logic here:
// Place your webhook handling code after this line:
console.log("Webhook received:", data)
bright-data-unlock-webhook-demo/
├── app/
│ ├── api/
│ │ └── webhook/
│ │ └── route.js # Webhook endpoint
│ └── page.js # Home page
├── package.json
└── README.md
View webhook logs in the Vercel dashboard:
- Go to your project dashboard on Vercel
- Click on "Functions" tab
- Select your webhook function to view logs
- Monitor incoming requests and responses
-
Webhook not receiving data
- Check the URL is correct:
/api/webhook
- Ensure Content-Type is
application/json
- Check the URL is correct:
-
Deployment fails
- Check Vercel build logs in the dashboard
- Ensure all dependencies are properly listed
-
Function timeout
- Webhook processing should complete within 10 seconds (Hobby tier)
- For longer processing, consider async handling
For deployment issues, check the Vercel documentation or open an issue in this repository.