{"id":32172700,"url":"https://github.com/annatel/captain_hook","last_synced_at":"2026-02-21T12:01:27.822Z","repository":{"id":43191213,"uuid":"292029041","full_name":"annatel/captain_hook","owner":"annatel","description":"Ordered webhooks notifications","archived":false,"fork":false,"pushed_at":"2025-02-19T15:33:57.000Z","size":271,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-11-21T23:20:20.373Z","etag":null,"topics":["captainhook","elixir","elixir-library","webhook"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annatel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-01T15:02:32.000Z","updated_at":"2025-02-19T15:33:13.000Z","dependencies_parsed_at":"2024-08-18T15:09:26.614Z","dependency_job_id":null,"html_url":"https://github.com/annatel/captain_hook","commit_stats":{"total_commits":93,"total_committers":3,"mean_commits":31.0,"dds":0.06451612903225812,"last_synced_commit":"af6fb83101c0330794c55c72beec4214afe14a11"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/annatel/captain_hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annatel%2Fcaptain_hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annatel%2Fcaptain_hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annatel%2Fcaptain_hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annatel%2Fcaptain_hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annatel","download_url":"https://codeload.github.com/annatel/captain_hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annatel%2Fcaptain_hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29680147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captainhook","elixir","elixir-library","webhook"],"created_at":"2025-10-21T18:42:32.397Z","updated_at":"2026-02-21T12:01:27.814Z","avatar_url":"https://github.com/annatel.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CaptainHook\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/annatel/captain_hook/CI?cacheSeconds=3600\u0026style=flat-square)](https://github.com/annatel/captain_hook/actions) [![GitHub issues](https://img.shields.io/github/issues-raw/annatel/captain_hook?style=flat-square\u0026cacheSeconds=3600)](https://github.com/annatel/captain_hook/issues) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?cacheSeconds=3600?style=flat-square)](http://opensource.org/licenses/MIT) [![Hex.pm](https://img.shields.io/hexpm/v/captain_hook?style=flat-square)](https://hex.pm/packages/captain_hook) [![Hex.pm](https://img.shields.io/hexpm/dt/captain_hook?style=flat-square)](https://hex.pm/packages/captain_hook)\n\nOrdered signed webhook notifications. Support multiple endpoints for each webhook.\n\n## Installation\n\nCaptainHook is published on [Hex](https://hex.pm/packages/captain_hook).  \nThe package can be installed by adding `captain_hook` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:captain_hook, \"~\u003e 3.0\"}\n  ]\nend\n```\n\nAfter the packages are installed you must create a database migration for each versionto add the captain_hook tables to your database:\n\n```elixir\ndefmodule CaptainHook.TestRepo.Migrations.CreateCaptainHookTables do\n  use Ecto.Migration\n\n  def up do\n    Queuetopia.Migrations.up()\n    Padlock.Mutexes.Migrations.V1.up()\n    CaptainHook.Migrations.up()\n  end\n\n  def down do\n    Queuetopia.Migrations.down()\n    Padlock.Mutexes.Migrations.V1.down()\n    CaptainHook.Migrations.down()\n  end\nend\n```\n\nThis will run all of CaptainHook's versioned migrations for your database. Migrations between versions are idempotent and will never change after a release. As new versions are released you may need to run additional migrations.\n\nNow, run the migration to create the table:\n\n```sh\nmix ecto.migrate\n```\n\n## Usage\n\n```elixir\nwebhook_endpoint = CaptainHook.create_webhook_endpoint(%{\n  webhook: \"my_webhook_name\",\n  url: \"https://webhook.site/538bb308-4dd8-4008-a19b-4e4a5758ef29\",\n  livemode: true,\n  enabled_notification_patterns: [%{pattern: \"*\"}]\n})\n\n# Get the webhook_endpoint secret in order to verify the webhook signature\n%CaptainHook.WebhookEndpoint{secret: secret} =\n  CaptainHook.get_webhook_endpoint(webhook_endpoint.id, includes: [:secret])\n\n# Notify - it will enqueue the notification and send it in its turn\n{:ok, CaptainHook.WebhookNotification{} = webhook_notification} =\n  CaptainHook.notify(\n    \"my_webhook_name\",\n    true,\n    \"notification_ref\",\n    %{\"my\" =\u003e \"data\", \"to\" =\u003e \"report\"}\n  )\n```\n\n## CaptainHook client\n\nWant to verify the authenticity of a captain_hook request ? you can use the [CaptainHookClient](https://github.com/annatel/captain_hook_client).\n\nThe docs can be found at [https://hexdocs.pm/captain_hook](https://hexdocs.pm/captain_hook).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannatel%2Fcaptain_hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannatel%2Fcaptain_hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannatel%2Fcaptain_hook/lists"}