Project

hooky

0.0
No release in over a year
Hooky is a tool for testing webhooks
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.21.0
~> 1.3
 Project Readme

Hooky

Hooky is a Ruby gem that provides a simple way to test webhooks.

By storing example request data and configuration in a .hooky directory in your Rails root directory, you can easily test webhooks by running hooky <webhook_name>.

You can create as many webhooks as you required but they must be named like so:

  • .hooky/<webhook_name>/data.json
  • .hooky/<webhook_name>/config.json

The config.json file contains details such as the URL, HTTP Method and any headers. For example:

{
  "url": "https://example.com/webhooks/order.created",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json"
  }
}

The data.json file will be the request body that is sent. For example:

{
  "id": 123,
  "name": "John Doe"
}

Installation

Install the gem by running gem install hooky.

Usage

# To add the hooky gem to your Gemfile, create a .hooky directory and create an example webhook, run:
hooky init

# To test a webhook, run:
hooky hook <webhook_name>

To add the gem to your Rails app and create an example webhook, run bundle exec hooky init. This will create a .hooky directory and

Then to test this webhook, run rails hooky order.created and it will send a request to the URL specified in the data.json file.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/deanpcmad/hooky.

License

The gem is available as open source under the terms of the MIT License.