Unhook CLI Tool
The Unhook CLI is a powerful command-line interface that enables developers to test webhooks locally without exposing their development environment to the internet.Overview
The CLI tool provides a seamless way to:- Create shareable webhook URLs that route to your local environment
- Monitor webhook events in real-time
- Debug webhook payloads and responses
- Collaborate with team members using shared webhook configurations
Installation
Install the Unhook CLI globally using your preferred package manager:Quick Start
-
Initialize your project:
-
Start listening for webhooks:
-
Use the generated webhook URL in your provider’s settings:
Core Features
Local Webhook Routing
The CLI creates a secure tunnel that routes incoming webhooks to your local development server:Real-time Monitoring
Monitor webhook activity directly in your terminal:Team Collaboration
Share webhook URLs across your team while maintaining individual environments:Configuration
Configuration File
Create anunhook.yaml
file in your project root:
Environment Variables
All CLI options can be set via environment variables:Command Reference
unhook listen
Start listening for webhook events.
Options:
--port, -p
: Local port to deliver requests to--webhook-id, -t
: Webhook ID to use--client-id, -c
: Unique client ID for team routing--redirect, -r
: Redirect URL instead of local port--debug, -d
: Enable debug logging--ping
: Health check configuration
unhook init
Initialize a new Unhook project.
Examples:
unhook status
Check the status of your webhook connection.
Examples:
Advanced Features
Health Checks
Configure health checks for your endpoints:Multiple Destinations
Route different webhook types to different endpoints:Authentication
Configure API key authentication for private webhooks:Integration Examples
Stripe Webhooks
GitHub Webhooks
Clerk Authentication
Troubleshooting
Common Issues
Connection Issues
Connection Issues
- Check your internet connection
- Verify the webhook ID is correct
- Ensure the port is available and not blocked by firewall
Authentication Problems
Authentication Problems
- Clear auth data:
rm ~/.unhook/auth-storage.json
- Re-run initialization:
npx @unhook/cli init
- Verify API key is correct
Webhook Not Receiving Events
Webhook Not Receiving Events
- Check webhook URL is correctly configured in provider dashboard
- Verify webhook is active in Unhook dashboard
- Enable debug mode:
unhook listen --debug
Debug Mode
Enable debug logging for detailed troubleshooting:Best Practices
- Use Client IDs: Always specify a meaningful client ID in team environments
- Enable Health Checks: Configure health checks for all endpoints
- Use Configuration Files: Keep settings in version control for team consistency
- Monitor Logs: Use debug mode when troubleshooting issues
- Secure API Keys: Store sensitive information in environment variables
Next Steps
- VS Code Extension - Monitor webhooks in your editor
- Team Collaboration - Share webhooks with your team
- Provider Integrations - Connect with popular services
- Security Features - Learn about data protection