Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hookscope

Inspect, debug and replay webhooks with ease.

Hookscope is a developer tool for receiving, inspecting and testing webhooks. It provides temporary and permanent webhook endpoints that allow developers to capture incoming HTTP requests, analyze payloads, debug integrations and replay events during development.

Webhook integrations are used everywhere — payment systems, GitHub events, CI/CD pipelines, automation platforms, SaaS integrations and internal services. Debugging these integrations is often difficult because developers need to expose local applications, inspect incoming data, verify headers and reproduce failed events.

Hookscope simplifies this process by providing a dedicated webhook inbox where you can receive requests, inspect every detail and simulate different responses.

Hookscope dashboard preview

Who is Hookscope for?

Hookscope is designed for:

  • Backend developers building and debugging webhook integrations.
  • Frontend developers testing communication with external services.
  • DevOps engineers validating CI/CD and automation workflows.
  • API developers testing request formats, headers and retry behavior.
  • Teams building SaaS integrations that need visibility into incoming events.

Live version

Try Hookscope without installation:

➡️ https://hookscope.ycode.pl


Documentation


Using the hosted version

The easiest way to use Hookscope is through the live instance:

https://hookscope.ycode.pl

No installation is required.

  1. Open Hookscope.
  2. Copy your webhook endpoint.
  3. Configure your service to send webhook requests to this URL.
  4. Inspect incoming requests directly in the dashboard.

Example endpoint:

https://hookscope.ycode.pl/hook/SESSION_ID

Self-hosting

Hookscope can be deployed on your own infrastructure using Docker Compose.

Requirements

Before running Hookscope, install:

  • Docker
  • Docker Compose

Installation

Clone the repository:

git clone https://github.com/your-org/hookscope.git

cd hookscope

Create environment files:

cp .env.example .env
cp ./apps/api/.env.example ./apps/api/.env

Adjust environment variables according to your environment.

Start services

Run:

docker compose up -d

Run database migrations:

npm run db:migrate

The stack includes:

  • Hookscope frontend
  • API server
  • PostgreSQL database
  • required infrastructure services

After startup, open:

http://localhost:{PORT_FROM_ENV}

Configuring responses with strategy.yml

Hookscope allows you to customize webhook endpoint behavior using the strategy.yml file.

The strategy file defines rules that decide how incoming webhook requests should be handled. Each rule can match specific requests, evaluate custom conditions and return different responses depending on the result.

This makes it possible to simulate external webhook providers, test error handling, validate payloads and reproduce different integration scenarios.

Basic structure

A strategy file contains a list of rules:

rules:
  - name: example-rule
    match:
      method: POST

    conditions:
      - js: |
          context.body.example === true
        ok:
          status: 200
          body:
            message: "accepted"
        fail:
          status: 400
          body:
            message: "invalid request"

  - name: fallback
    response:
      status: 404
      body:
        error: "not found"

Rules

Each rule represents a possible request handling scenario.

Example:

- name: product-webhook

The name field is used to identify the rule.


Matching requests

Rules can define which requests they apply to using the match section.

Example:

match:
  method: POST

A rule can be limited based on request properties such as:

  • HTTP method
  • request details
  • incoming webhook data

Only matching requests are evaluated by the rule.


Conditions

Conditions allow you to execute custom JavaScript logic against the incoming request.

Example:

conditions:
  - js: |
      context.body.product_id === 10

The context object contains information about the received webhook request.

You can use it to inspect:

  • request body
  • headers
  • query parameters
  • request metadata

The condition result determines which response is returned.


Successful condition response

When the JavaScript condition returns true, Hookscope uses the ok response.

Example:

ok:
  status: 200
  headers:
    "x-response": "accepted"
  body:
    message: "product accepted"

Supported options:

  • status — HTTP response status code
  • headers — custom response headers
  • body — response payload

Failed condition response

When the condition returns false, Hookscope uses the fail response.

Example:

fail:
  status: 400
  body:
    message: "wrong product"

This can be used to simulate validation errors or rejected webhook events.


Fallback responses

A rule without conditions can act as a fallback handler.

Example:

- name: fallback
  response:
    status: 404
    body:
      error: "not found"

The fallback rule is useful for defining the default behavior when no previous rule matches.


Complete example

rules:
  - name: product-webhook
    match:
      method: POST

    conditions:
      - js: |
          context.body.product_id === 10
        ok:
          status: 200
          headers:
            "x-response": "accepted"
          body:
            message: "product accepted"

        fail:
          status: 400
          body:
            message: "wrong product"

  - name: fallback
    response:
      status: 404
      body:
        error: "not found"

With this configuration:

  • POST requests containing product_id: 10 receive 200 OK.
  • Other products receive 400 Bad Request.
  • Requests that do not match any rule receive 404 Not Found.

Use cases

The strategy.yml file can be used for:

  • testing webhook retries,
  • simulating provider failures,
  • validating payload handling,
  • mocking third-party integrations,
  • testing different API responses without changing application code.

Contributing

Contributions are welcome.

To contribute:

  1. Fork the repository.
  2. Create a feature branch.
git checkout -b feature/my-feature
  1. Make your changes.
  2. Test your implementation.
  3. Open a pull request.

When contributing, please:

  • keep changes focused,
  • add documentation for new features,
  • follow the existing project structure,
  • include tests where applicable.

License

MIT License

Copyright (c) Hookscope contributors

Contributors

Languages