Tentahook
Elixir handler for GitHub Webhooks.
Installation
-
Add
tentahookto your list of dependencies inmix.exs:
```elixir
def deps do
[{:tentahook, "~> 0.1.0"}]
end
```-
Ensure
tentahookis started before your application:
```elixir
def application do
[applications: [:tentahook]]
end
```Usage
Check this example.
To start:
Tentahook.start_link(tentahook_opts, cowboy_opts)
If cowboy_opts is empty then default port is 4000 (and all available IPs).
More info about cowboy_opts.
To set new Tentahook config:
Tentahook.reset_conf(tentahook_opts)Available keys in config:
-
handler - mandatory, handler which implements
handle_webhookcallback. - secrets - list of GitHub secrets.
-
unsafe - set this to
trueand secrets to[]if you don't want to validate incoming payloads.