Skip to main content

Configuration File

The unhook.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:

JSON

JavaScript/TypeScript

Configuration File Locations

The CLI and VS Code extension will look for configuration files in the following order:
  1. unhook.yml (current directory)
  2. unhook.yaml (current directory)
  3. unhook.config.yml (current directory)
  4. unhook.config.yaml (current directory)
  5. unhook.config.js (current directory)
  6. unhook.config.cjs (current directory)
  7. unhook.config.ts (current directory)
  8. unhook.config.json (current directory)

Best Practices

  1. Use YAML Format: YAML is the most readable and commonly used format
  2. Use Meaningful Names: Choose descriptive names for your endpoints
  3. Enable Health Checks: Configure health checks for all endpoints
  4. Use Environment Variables: Store sensitive information in environment variables
  5. Version Control: Keep your configuration in version control
  6. Documentation: Document your configuration for team members
  7. Validation: Use the CLI to validate your configuration

Troubleshooting

Common Issues

  1. Configuration Loading
    • Check file permissions
    • Verify YAML/JSON syntax
    • Ensure required fields are present
    • Check file location
  2. URL Configuration
    • Verify URL format
    • Check port availability
    • Test endpoint accessibility
    • Ensure protocol is specified
  3. Health Checks
    • Verify health check endpoint
    • Check response format
    • Monitor health check logs
    • Test endpoint manually
  4. Source Configuration
    • Verify source names match delivery rules
    • Check secret configuration
    • Ensure proper header configuration
    • Test webhook verification

Support