Configuration File
Theunhook.yml file is the primary way to configure Unhook. It supports the following structure:
Basic Configuration
Here’s a basic configuration example:Advanced Configuration
Multiple Destinations
Configure multiple endpoints for different webhook types:Health Checks
Configure health checks for your endpoints:URL Configuration
Configure URLs with different formats:Source Configuration
Configure webhook sources with advanced options:Self-Hosted Configuration
Configure Unhook to work with self-hosted instances:Environment Variables
All configuration options can be set via environment variables:Team Configuration
Shared Configuration
Teams can share a single webhook configuration:Individual Configuration
Each developer can have their own configuration:Configuration File Formats
Unhook supports multiple configuration file formats:YAML (Recommended)
JSON
JavaScript/TypeScript
Configuration File Locations
The CLI and VS Code extension will look for configuration files in the following order:unhook.yml(current directory)unhook.yaml(current directory)unhook.config.yml(current directory)unhook.config.yaml(current directory)unhook.config.js(current directory)unhook.config.cjs(current directory)unhook.config.ts(current directory)unhook.config.json(current directory)
Best Practices
- Use YAML Format: YAML is the most readable and commonly used format
- Use Meaningful Names: Choose descriptive names for your endpoints
- Enable Health Checks: Configure health checks for all endpoints
- Use Environment Variables: Store sensitive information in environment variables
- Version Control: Keep your configuration in version control
- Documentation: Document your configuration for team members
- Validation: Use the CLI to validate your configuration
Troubleshooting
Common Issues
-
Configuration Loading
- Check file permissions
- Verify YAML/JSON syntax
- Ensure required fields are present
- Check file location
-
URL Configuration
- Verify URL format
- Check port availability
- Test endpoint accessibility
- Ensure protocol is specified
-
Health Checks
- Verify health check endpoint
- Check response format
- Monitor health check logs
- Test endpoint manually
-
Source Configuration
- Verify source names match delivery rules
- Check secret configuration
- Ensure proper header configuration
- Test webhook verification