{"_id":"@djordje41/medusa-plugin-webhooks","_rev":"7-3f932d1062832a2860e84c283c3b4884","name":"@djordje41/medusa-plugin-webhooks","dist-tags":{"latest":"1.0.6-dev"},"versions":{"1.0.0-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.0-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.0-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"58bf7358b6991a8964b36abf85805490e116b061","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.0-dev.tgz","fileCount":14,"integrity":"sha512-DYEA0GEc67Za0XrU1zlkTJs4e3iBijMPPsbhOHuFp3cgxp8sUcug4V+qLcOcwN+BfLH9dg7njxJDywcILxFVgQ==","signatures":[{"sig":"MEUCIC8gHIckGmwi1EMDIcTbzGMfEV1+a/OFdgCvMKGRQUYaAiEA2hiM2PTWr94bReEdGH724O9daHGQ/lR65ZKqYPkxagI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32781},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"tsc"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"peerDependencies":{"@medusajs/medusa":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.0-dev_1759177240389_0.06167864765776532","host":"s3://npm-registry-packages-npm-production"}},"1.0.1-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.1-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.1-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"ae099cd08a6412b7a932a5c8f026849fe828e566","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.1-dev.tgz","fileCount":18,"integrity":"sha512-8jiM3gWtM/9F+YkxAGUO/ytI7jM0q602Ncv9rloG4v4Ew5V1GjUeHs9NPtehiZ6mpb+suTm/RAhW2K7NftAQrg==","signatures":[{"sig":"MEUCIQDcXBFSnueSPQmZC+cxrqa9eRrtiTjOn4oTjDVHpt8QIAIgIsW+daM5K7TQXps6UeAs4aTWkhfVd74v84W/ZXo5yNA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34338},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"rimraf dist && tsc","prepublishOnly":"cross-env NODE_ENV=production tsc --build"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"peerDependencies":{"@medusajs/medusa":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.1-dev_1759177856532_0.5891027732570644","host":"s3://npm-registry-packages-npm-production"}},"1.0.2-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.2-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.2-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"b3a43f3e265bd98a75da14ba316a4fe72fbe61c5","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.2-dev.tgz","fileCount":18,"integrity":"sha512-4fktLiGuj+yTPqoPKzqVOgGtYkXYlIiMuZOs7OHrDTpgDz8y77SKKyYKPALeps03nI41qFa8E7IwVr65rcQVFA==","signatures":[{"sig":"MEQCICx3jvhgjPfNrE5kgq+CEvghYizjdQjTodSCILA5XtJiAiBAV36KLkwghPULwDgQUS6DDUoZG75aHHjzmC8YgwCSSw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34543},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"rimraf dist && tsc","prepublishOnly":"cross-env NODE_ENV=production tsc --build"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@djordje41/medusa-plugin-webhooks":"^1.0.1-dev"},"_hasShrinkwrap":false,"peerDependencies":{"@medusajs/medusa":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.2-dev_1759180182760_0.7963304804720583","host":"s3://npm-registry-packages-npm-production"}},"1.0.3-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.3-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.3-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"1e42babb1512bd827dab0d2e6ec0e9293de93441","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.3-dev.tgz","fileCount":18,"integrity":"sha512-Cc/+HU2oNqMXOuVsE1v5uaVvIWzqzjekSUMJh3H4dB6cVGC7zltigWhIJV8+B08v7ObdvumiUWRLcLkNwx/jNg==","signatures":[{"sig":"MEQCIHuSJgRYfQ+g4jh2eh4UB/SJGQU+mADEcpnXRPxNYmgEAiAlLBqD0RGayA57xfEb9F6Gp7bVCrqRBXaBo9SEPOhqdA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34302},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"rimraf dist && tsc","prepublishOnly":"cross-env NODE_ENV=production tsc --build"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@djordje41/medusa-plugin-webhooks":"^1.0.1-dev"},"_hasShrinkwrap":false,"peerDependencies":{"@medusajs/medusa":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.3-dev_1759180469854_0.9463824452313643","host":"s3://npm-registry-packages-npm-production"}},"1.0.4-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.4-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.4-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"5335c914c48505fcab871142cbeda5b160494b69","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.4-dev.tgz","fileCount":18,"integrity":"sha512-pd023Pescsn/db4aw15fsK662CK9GDiiT73lMY4sdrwUtkkYBozEKN5jWQa/iFznoGR2hzbrmXp2DBZ0RIYP0w==","signatures":[{"sig":"MEUCIQCQmZ0vRmpGaRJ0QdTd6PLNHK1Srwf+qmf4CB0vtOoF7QIgBIY6F/ax+HfYjHmiTsetm5AqkxHUIasUhm5qUUqbFvE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34155},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"rimraf dist && tsc","prepublishOnly":"cross-env NODE_ENV=production tsc --build"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.4-dev_1759180652554_0.2800214394458773","host":"s3://npm-registry-packages-npm-production"}},"1.0.5-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.5-dev","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","_id":"@djordje41/medusa-plugin-webhooks@1.0.5-dev","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"dist":{"shasum":"256881b5664d22e9ca186ae4eafef94cc3f551a2","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.5-dev.tgz","fileCount":18,"integrity":"sha512-hE6vbWZ8bqtadeOZk19IOUtmf48pYeEzEJHtivFJk3en21VVXOW43q7FK6ajsF5g40Jus51tkK4rHftYdwsWxg==","signatures":[{"sig":"MEUCIQD9FXoCqypOrB++BFZOF4R1lJWxmOusDIJm/BqAK92JPwIgfaD9UvOLVMDf6E9gEK1v0HelAtCeemMNYtmYqntlrrI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34819},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","scripts":{"build":"rimraf dist && tsc","prepublishOnly":"cross-env NODE_ENV=production tsc --build"},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"_npmVersion":"10.9.3","description":"Webhooks plugin for Medusa v1","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/medusa-plugin-webhooks_1.0.5-dev_1759181348948_0.31023346869624424","host":"s3://npm-registry-packages-npm-production"}},"1.0.6-dev":{"name":"@djordje41/medusa-plugin-webhooks","version":"1.0.6-dev","description":"Webhooks plugin for Medusa v1","keywords":["medusa","webhooks","plugin"],"author":{"name":"Eklix"},"license":"MIT","scripts":{"prepublishOnly":"cross-env NODE_ENV=production tsc --build","build":"rimraf dist && tsc"},"_id":"@djordje41/medusa-plugin-webhooks@1.0.6-dev","gitHead":"21f238ffc42ef6cbbb342b49d6d90024e93bf6ca","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-J7HgXfTCd91GsHGgPe78M0YExUyCyxvzBXl5liGzx14mdEz4vKzf0tmvHPf8cAoveLbzxtZbdmy1umdOMccncQ==","shasum":"036c87c5a362cbbb795eec46c7e188d12167b7d5","tarball":"https://registry.npmjs.org/@djordje41/medusa-plugin-webhooks/-/medusa-plugin-webhooks-1.0.6-dev.tgz","fileCount":15,"unpackedSize":32953,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHnmojDgm+QOLawn5c76U0WZqnRifHp9XvHB/eYST0FdAiEA7nt4euiUHB+mKn5qdSbvlbphVYfoTg+Wpqez+7b998I="}]},"_npmUser":{"name":"djordje41","email":"djordje.zubac@codebears.io"},"directories":{},"maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/medusa-plugin-webhooks_1.0.6-dev_1759181624163_0.9309797581155883"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-29T20:20:40.265Z","modified":"2025-09-29T21:33:44.529Z","1.0.0-dev":"2025-09-29T20:20:40.584Z","1.0.1-dev":"2025-09-29T20:30:56.734Z","1.0.2-dev":"2025-09-29T21:09:42.936Z","1.0.3-dev":"2025-09-29T21:14:30.036Z","1.0.4-dev":"2025-09-29T21:17:32.738Z","1.0.5-dev":"2025-09-29T21:29:09.128Z","1.0.6-dev":"2025-09-29T21:33:44.368Z"},"author":{"name":"Eklix"},"license":"MIT","keywords":["medusa","webhooks","plugin"],"description":"Webhooks plugin for Medusa v1","maintainers":[{"name":"djordje41","email":"djordje.zubac@codebears.io"}],"readme":"# Webhooks Plugin (Medusa v1)\r\n\r\nThis plugin adds configurable webhooks to your Medusa v1 server:\r\n- Admin UI to manage endpoints and auth keys, and to view delivery logs\r\n- Subscribers for `order.placed` and `product.updated`\r\n- Dispatcher that forwards events to configured destinations and stores response logs\r\n\r\n## Enable the plugin (local/staging/prod)\r\n\r\nEdit `backend/medusa-config.js` and add:\r\n\r\n```js\r\nconst plugins = [\r\n  // ... other plugins\r\n  {\r\n    resolve: \"src/plugins/webhooks\",\r\n  }\r\n]\r\n```\r\n\r\nOptionally gate by env var:\r\n\r\n```js\r\nprocess.env.WEBHOOKS_ENABLED === \"true\" && {\r\n  resolve: \"src/plugins/webhooks\",\r\n  options: { headerName: \"X-Webhook-Key\" }\r\n}\r\n```\r\n\r\n## Run DB migrations\r\n\r\nCreates three tables: `webhook_endpoint`, `webhook_key`, `webhook_log`.\r\nRun your project’s migration command, e.g.:\r\n\r\n```bash\r\nnpm run migrate\r\n# or\r\nnpm run typeorm -- migration:run\r\n```\r\n\r\n## Start the server\r\n\r\n```bash\r\ncd backend\r\nnpm run build && npm run start\r\n```\r\n\r\n## Configure in Admin\r\n\r\nOpen Admin and go to the Webhooks page (`backend/src/admin/webhooks/page.tsx`).\r\n- Endpoints: add `event` (e.g. `order.placed`), method (POST default), URL, optional JSON headers, enabled flag\r\n- Auth Keys: create a key; the latest enabled key is injected using `headerName`\r\n- Logs: recent deliveries with status, duration, and truncated response\r\n\r\n## Default events\r\n\r\n- `order.placed`\r\n- `product.updated`\r\n\r\nAdd more in `backend/src/plugins/webhooks/subscribers/webhook-subscriber.ts`.\r\n\r\n## Admin API (mounted at /admin/webhooks)\r\n\r\n- `GET /endpoints`\r\n- `POST /endpoints` { url, method, event, headers, enabled }\r\n- `PUT /endpoints/:id`\r\n- `DELETE /endpoints/:id`\r\n- `GET /keys`\r\n- `POST /keys` { name, key, enabled }\r\n- `DELETE /keys/:id`\r\n- `GET /logs?limit=&offset=`\r\n\r\n## Local enablement checklist\r\n\r\n1. Add plugin to `medusa-config.js`\r\n2. Run migrations\r\n3. Build & start backend\r\n4. In Admin: create a key and an endpoint\r\n5. Trigger an event and verify logs\r\n\r\n## Staging/Production notes\r\n\r\n- Ensure outbound network access to webhook destinations\r\n- Run migrations during deploy\r\n- Configure `WEBHOOKS_ENABLED=true` if you gated it\r\n- Adjust `headerName` if needed\r\n\r\n## Behavior & limits\r\n\r\n- POST/PUT/PATCH send JSON body; GET/DELETE send payload as query params\r\n- Endpoint-level headers can be set via the Admin form (JSON)\r\n- Response bodies are truncated at 500 chars in logs\r\n- Structured to ease future Medusa v2 migration\r\n","readmeFilename":"README.md"}