{"id":13780612,"url":"https://github.com/fixate/feathers-stripe-webhooks","last_synced_at":"2025-06-17T21:34:09.453Z","repository":{"id":51324393,"uuid":"66475710","full_name":"fixate/feathers-stripe-webhooks","owner":"fixate","description":"Handle stripe webhooks in a feathersjs service","archived":false,"fork":false,"pushed_at":"2023-07-18T20:31:27.000Z","size":1298,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-30T12:17:22.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fixate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-24T15:24:02.000Z","updated_at":"2022-04-23T21:31:57.000Z","dependencies_parsed_at":"2024-01-17T01:33:56.066Z","dependency_job_id":"08c94dd4-d5a6-4cd6-9c6e-73fb70f47406","html_url":"https://github.com/fixate/feathers-stripe-webhooks","commit_stats":{"total_commits":45,"total_committers":4,"mean_commits":11.25,"dds":0.6222222222222222,"last_synced_commit":"25839b9b45d0d4473f9b1067e8630ec54deb7024"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/fixate/feathers-stripe-webhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Ffeathers-stripe-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Ffeathers-stripe-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Ffeathers-stripe-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Ffeathers-stripe-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixate","download_url":"https://codeload.github.com/fixate/feathers-stripe-webhooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixate%2Ffeathers-stripe-webhooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259385805,"owners_count":22849513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-03T18:01:17.819Z","updated_at":"2025-06-17T21:34:04.438Z","avatar_url":"https://github.com/fixate.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Payments"],"readme":"# feathers-stripe-webhooks\n\n[![Build Status](https://travis-ci.org/fixate/feathers-stripe-webhooks.svg?branch=master)](https://travis-ci.org/fixate/feathers-stripe-webhooks)\n\n## Installation\n\n`npm install --save feathers-stripe-webhooks`\n\n\n## Usage\n\n```javascript\n// default.json\n{\n  \"stripe\": {\n    \"apiKey\": \"sk_test_MP5bNSfgUyBG2cq3bCntjfLm\",\n    \"webhooks\": {\n      \"signature\": {\n        \"verify\": true,\n        \"secret\": \"whsec_sZYN4b3x00PWFvTejfY5xudYx4D8TvW9\"\n      }\n    }\n  }\n}\n```\n\n```javascript\n// app.js\nconst stripe = require('stripe')(config.stripe.apiKey);\nconst { stripeSignatureValidationMiddleware } = require('feathers-stripe-webhooks');\n\nif (config.stripe.webhooks.signature.verify)\n  app.configure(stripeSignatureValidationMiddleware(stripe, '/stripe/webhooks', config.stripe.webhooks.signature.secret));\n\n// run other body-parser rules here, i.e. app.use(bodyParser.json())\n```\n\n```javascript\n// stripe-webhooks.service.js\nconst { stripeWebhooksService } = require('feathers-stripe-webhooks');\nconst handlers = require('./stripe-webhooks.handlers');\nconst hooks = require('./stripe-webhooks.hooks');\n\nmodule.exports = function (app) {\n  app.use('/stripe/webhooks', stripeWebhooksService(handlers));\n\n  const service = app.service('stripe/webhooks');\n\n  service.hooks(hooks);\n};\n```\n\n```javascript\n// stripe-webhooks.handlers.js\nmodule.exports = {\n  customer: {\n    // Handles customer.created event\n    async created({ object, event, params, app }) {\n      // Handle webhook\n      // NOTE: Whatever you return will be returned as a response to stripe.\n      // If you return undefined feathers will 404 and the hook will fail\n      \n      params.doSomething = true;\n      \n      return {};\n    },\n    async updated({ object, event, params, app }) {\n      return {};\n    },\n    subscription: {\n      async created({ object, event, params, app }) {\n        return {};\n      },\n    },\n  },\n  invoice: {\n    // Handles invoice.created event\n    async created() { /*...*/ },\n  },\n  //....\n};\n```\n\n```javascript\n// stripe-webhooks.hooks.js\nmodule.exports = {\n  after: {\n    create: [\n      iff(hook =\u003e hook.params.doSomething,\n        doSomething()\n      ),\n    ],\n  },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixate%2Ffeathers-stripe-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixate%2Ffeathers-stripe-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixate%2Ffeathers-stripe-webhooks/lists"}