{"id":47096976,"url":"https://github.com/rails-designer/fuik","last_synced_at":"2026-04-02T21:03:01.985Z","repository":{"id":332365229,"uuid":"1111008734","full_name":"Rails-Designer/fuik","owner":"Rails-Designer","description":"Rails engine that catches and stores webhooks from any provider","archived":false,"fork":false,"pushed_at":"2026-04-01T04:24:04.000Z","size":3429,"stargazers_count":9,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-01T05:50:05.647Z","etag":null,"topics":["gem","rails","rails-engine","rails-gem","webhooks","webhooks-catcher"],"latest_commit_sha":null,"homepage":"https://railsdesigner.com/fuik/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rails-Designer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"MIT-LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Rails-Designer"]}},"created_at":"2025-12-06T04:52:40.000Z","updated_at":"2026-04-01T04:24:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Rails-Designer/fuik","commit_stats":null,"previous_names":["rails-designer/fuik"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Rails-Designer/fuik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Ffuik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Ffuik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Ffuik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Ffuik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rails-Designer","download_url":"https://codeload.github.com/Rails-Designer/fuik/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rails-Designer%2Ffuik/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31316130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"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":["gem","rails","rails-engine","rails-gem","webhooks","webhooks-catcher"],"created_at":"2026-03-12T14:39:45.628Z","updated_at":"2026-04-02T21:03:01.975Z","avatar_url":"https://github.com/Rails-Designer.png","language":"Ruby","funding_links":["https://github.com/sponsors/Rails-Designer"],"categories":[],"sub_categories":[],"readme":"# Fuik\n\n**A fish trap for webhooks**\n\nFuik (Dutch for fish trap) is a Rails engine that catches and stores webhooks from any provider. View all events in the admin interface, then create event classes to add your business logic.\n\n\u003cimg alt=\"Fuik admin interface\" src=\"https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/docs/webhooks-index.jpg\" style=\"max-width: 100%;\"\u003e\n\n\n**Sponsored By [Rails Designer](https://railsdesigner.com/)**\n\n\u003ca href=\"https://railsdesigner.com/\" target=\"_blank\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/logo-dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/logo-light.svg\"\u003e\n    \u003cimg alt=\"Rails Designer\" src=\"https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/logo-light.svg\" width=\"240\" style=\"max-width: 100%;\"\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n\n## Quick start\n\n```bash\n# Install\nbundle add fuik\nbin/rails generate fuik:install\nbin/rails db:migrate\n\n# Point your webhook to\nPOST https://yourdomain.com/webhooks/stripe\n```\n\nThat's it. Webhooks are captured and visible at `/webhooks`.\n\n\n## Installation\n\nAdd to your Gemfile:\n```ruby\ngem \"fuik\"\n```\n\nThen run:\n```bash\nbundle install\nbin/rails generate fuik:install\nbin/rails db:migrate\n```\n\nThe engine mounts at `/webhooks` automatically.\n\n\n## Usage\n\n### View events\n\nVisit `/webhooks` to see all received webhooks. Click any event to view all the payload details and copy the payload or download as JSON.\n\n\u003cimg alt=\"Fuik event detail interface\" src=\"https://raw.githubusercontent.com/Rails-Designer/fuik/HEAD/.github/docs/event-detail.jpg\" style=\"max-width: 100%;\"\u003e\n\n⚠️ The `/webhooks` path is by default not protected. Easiest is to set `Fuik::Engine.config.events_controller_parent` to a controller that requires authentication.\n\n\n### Add business logic\n\nGenerate classes for events you want to process:\n```bash\nbin/rails generate fuik:provider stripe checkout_session_completed\n```\n\nThis creates:\n- `app/webhooks/stripe/base.rb`\n- `app/webhooks/stripe/checkout_session_completed.rb`\n\nEach class is a thin wrapper around your business logic:\n```ruby\nmodule Stripe\n  class CheckoutSessionCompleted \u003c Base\n    def process!\n      User.find_by(id: payload.client_reference_id).tap do |user|\n        user.activate_subscription!\n        user.send_welcome_email\n\n        # etc.\n      end\n\n      @webhook_event.processed!\n    end\n  end\nend\n```\n\nThe `payload` method supports dot notation and standard hash methods:\n```ruby\n# Dot notation\npayload.client_reference_id\npayload.customer.email\n\n# Hash syntax (strings/symbols)\npayload[\"client_reference_id\"]\npayload[:customer_id]\n```\n\nImplement `Base.verify!` to enable signature verification:\n```ruby\nmodule Stripe\n  class Base \u003c Fuik::Event\n    def self.verify!(request)\n      secret = Rails.application.credentials.dig(:stripe, :signing_secret)\n      signature = request.headers[\"Stripe-Signature\"]\n\n      Stripe::Webhook.construct_event(\n        request.raw_post,\n        signature,\n        secret\n      )\n    rescue Stripe::SignatureVerificationError =\u003e error\n      raise Fuik::InvalidSignature, error.message\n    end\n  end\nend\n```\n\nIf `Provider::Base.verify!` exists, Fuik calls it automatically. Invalid signatures return 401 without storing the webhook.\n\n\n### Provider allowlist\n\nBy default:\n- **Development/test**: all providers are allowed\n- **Production/staging**: only providers in `app/webhooks/` are allowed\n\nConfigure with `Fuik::Engine.config.providers_allowed`:\n```ruby\n# Allow all (including production)\nFuik::Engine.config.providers_allowed = :all\n\n# Explicit allowlist (overrides directory scan)\nFuik::Engine.config.providers_allowed = %w[stripe github shopify]\n```\n\nUnknown providers return `404 Not Found`.\n\n\n### Pre-packaged providers\n\nFuik includes ready-to-use [templates for common providers](https://github.com/Rails-Designer/fuik/tree/main/lib/generators/fuik/provider/templates).\n\n\n### Event type \u0026 ID lookup\n\nFuik automatically extracts event types and IDs from common locations:\n\n**Event Type:**\n1. provider config (if exists);\n2. common headers (`X-Github-Event`, `X-Event-Type`, etc.);\n3. payload (`type`, `event`, `event_type`);\n4. falls back to `\"unknown\"`.\n\n**Event ID:**\n1. provider config (if exists);\n2. common headers (`X-GitHub-Delivery`, `X-Event-Id`, etc.);\n3. payload (`id`).\n4. falls back to MD5 hash of request body.\n\n\n#### Custom lookup via config\n\nCreate `app/webhooks/provider_name/config.yml`:\n```yaml\nevent_type:\n  source: header\n  key: X-Custom-Event\n\nevent_id:\n  source: payload\n  key: custom_id\n```\n\nThe options for `event_type`'s source are:\n\n- header\n- payload\n- static; for cases when no event type is present in header or payload\n\n\n## Add your custom provider\n\nHave a provider template others could use? Add it to [lib/generators/fuik/provider/templates/your_provider/](https://github.com/Rails-Designer/fuik/tree/main/lib/generators/fuik/provider/templates) and submit a PR!\n\nInclude:\n- `base.rb.tt` with signature verification (if applicable);\n- event class templates with helpful TODO comments.\n\n\n## Contributing\n\nThis project uses [Standard](https://github.com/testdouble/standard) for formatting Ruby code. Please make sure to run `rake` before submitting pull requests.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-designer%2Ffuik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frails-designer%2Ffuik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-designer%2Ffuik/lists"}