{"_id":"@ws-kit/plugins","_rev":"6-f11b3d1756f712abedffec426840e697","name":"@ws-kit/plugins","dist-tags":{"latest":"0.10.1"},"versions":{"0.7.0":{"name":"@ws-kit/plugins","version":"0.7.0","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"author":{"name":"Konstantin Tarkus"},"license":"MIT","_id":"@ws-kit/plugins@0.7.0","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"dist":{"shasum":"4cabd69e9fac79d49fc50914b74596e49ea7b321","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.7.0.tgz","fileCount":24,"integrity":"sha512-5o3cLnLwhuJzTv+9b7smibnbYWk0BrckZqOOZntnniOoXFE3Vs2zNvZqljenb9jybxjMMUrhPy77H0iIFFkFxQ==","signatures":[{"sig":"MEQCIDSI8Gd9+bVfItgWc0kGhdT0sGhoHOiuge+5U+A7FuMSAiA2IRHLjegIQn7WRKRrAcSwr/UXxHyj/NA/ESMgae612A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":106739},"main":"./index.js","type":"module","types":"./index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./rpc":{"types":"./rpc/index.d.ts","default":"./rpc/index.js"},"./pubsub":{"types":"./pubsub/index.d.ts","default":"./pubsub/index.js"},"./messaging":{"types":"./messaging/index.d.ts","default":"./messaging/index.js"}},"funding":{"url":"https://github.com/sponsors/koistya","type":"github"},"gitHead":"6d3f6cf7565bad547d6efc388e6840cd54e50b1c","_npmUser":{"name":"kriasoft-bot","email":"kriasoft@gmail.com"},"repository":{"url":"git+https://github.com/kriasoft/ws-kit.git","type":"git","directory":"packages/plugins"},"_npmVersion":"11.6.2","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"workspace:^","@ws-kit/plugins":"workspace:^"},"peerDependencies":{"@ws-kit/core":"^0.0.1","@ws-kit/plugins":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/plugins_0.7.0_1764541788990_0.21752510136046466","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@ws-kit/plugins","version":"0.8.0","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"author":{"name":"Konstantin Tarkus"},"license":"MIT","_id":"@ws-kit/plugins@0.8.0","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"dist":{"shasum":"38aa6e99f163e9ed81b2c32a0949c6c97443c587","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.8.0.tgz","fileCount":24,"integrity":"sha512-2WzDNi1bEiNLhXu/9zaDLulAH6c4IYWN8p0jQhl0jSY+8frv3TsmGcdhvvQFx4oUT2LulZQTFeoJhSuRPMxMyQ==","signatures":[{"sig":"MEYCIQDQ1Y8eeQfAddInXSYs3tXd9307HnY8mRojz4lb5qsENgIhAJVnDsdi/Sq0R4oyQxT7hafmHB2abp3d/rKiLiFknrKX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":106762},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./rpc":{"types":"./dist/rpc/index.d.ts","default":"./dist/rpc/index.js"},"./pubsub":{"types":"./dist/pubsub/index.d.ts","default":"./dist/pubsub/index.js"},"./messaging":{"types":"./dist/messaging/index.d.ts","default":"./dist/messaging/index.js"}},"funding":{"url":"https://github.com/sponsors/koistya","type":"github"},"gitHead":"b1d18ca9b170c34c784ff4b4d5b03d44e13148b3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1980e364-0774-4429-bb1b-85ed1d855874"}},"repository":{"url":"git+https://github.com/kriasoft/ws-kit.git","type":"git","directory":"packages/plugins"},"_npmVersion":"11.6.2","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"^0.8.0"},"peerDependencies":{"@ws-kit/core":"^0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/plugins_0.8.0_1764547610241_0.3287489172307263","host":"s3://npm-registry-packages-npm-production"}},"0.8.1":{"name":"@ws-kit/plugins","version":"0.8.1","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"author":{"name":"Konstantin Tarkus"},"license":"MIT","_id":"@ws-kit/plugins@0.8.1","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"dist":{"shasum":"86fb14996af5a474e1b7b68c8ef33a192f0eeddc","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.8.1.tgz","fileCount":24,"integrity":"sha512-esau9uPQCQ+FUuHGlrlQErxpG21ujyMlV5S5DslN1UDWLzCpJGpaDIRcRCG6Blc/3eBvq1Kv/MAiYYjqOUF2zA==","signatures":[{"sig":"MEUCIQCdO7ZSgR+5C0+S76hv9CA5m5Y2Wi69lnO6/8MyfNzcwAIgCyHFga456YB4DvZhdJ6VstNzO/8iLarwGCfhGu7f/ws=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.8.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":108101},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./rpc":{"types":"./dist/rpc/index.d.ts","default":"./dist/rpc/index.js"},"./pubsub":{"types":"./dist/pubsub/index.d.ts","default":"./dist/pubsub/index.js"},"./messaging":{"types":"./dist/messaging/index.d.ts","default":"./dist/messaging/index.js"}},"funding":{"url":"https://github.com/sponsors/koistya","type":"github"},"gitHead":"7ba20c305112106486d082bd4241806667c98b8d","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1980e364-0774-4429-bb1b-85ed1d855874"}},"repository":{"url":"git+https://github.com/kriasoft/ws-kit.git","type":"git","directory":"packages/plugins"},"_npmVersion":"11.6.2","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"^0.8.1"},"peerDependencies":{"@ws-kit/core":"^0.8.1"},"_npmOperationalInternal":{"tmp":"tmp/plugins_0.8.1_1764550070147_0.0717018362724462","host":"s3://npm-registry-packages-npm-production"}},"0.9.0":{"name":"@ws-kit/plugins","version":"0.9.0","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"author":{"name":"Konstantin Tarkus"},"license":"MIT","_id":"@ws-kit/plugins@0.9.0","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"dist":{"shasum":"107dd17503af2107300e4a653a1db2abc00839e5","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.9.0.tgz","fileCount":24,"integrity":"sha512-0OymNGIJme0dwjHAvQ4fuL/4GtWwWNV0PhhSAbyMTRam5eUnMT0jYGBeAh7PlGVK7ZWMSebsNzrpoDkeRJPzVA==","signatures":[{"sig":"MEUCIQDL4RvadvcY/OGgRScQoTMV50J88g7YJ0soOjmsz67T1AIgNbFG6cF++it8G4DMAU1hR8Cz6nchcVF3maIUR2MDRfk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.9.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":108505},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./rpc":{"types":"./dist/rpc/index.d.ts","default":"./dist/rpc/index.js"},"./pubsub":{"types":"./dist/pubsub/index.d.ts","default":"./dist/pubsub/index.js"},"./messaging":{"types":"./dist/messaging/index.d.ts","default":"./dist/messaging/index.js"}},"funding":{"url":"https://github.com/sponsors/koistya","type":"github"},"gitHead":"7f41d1c07b55142e2f575372066b7db0a6cc5362","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1980e364-0774-4429-bb1b-85ed1d855874"}},"repository":{"url":"git+https://github.com/kriasoft/ws-kit.git","type":"git","directory":"packages/plugins"},"_npmVersion":"11.6.2","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"^0.9.0"},"peerDependencies":{"@ws-kit/core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/plugins_0.9.0_1764885621741_0.9542208534053145","host":"s3://npm-registry-packages-npm-production"}},"0.10.0":{"name":"@ws-kit/plugins","version":"0.10.0","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"author":{"name":"Konstantin Tarkus"},"license":"MIT","_id":"@ws-kit/plugins@0.10.0","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"dist":{"shasum":"42cd29accc27f3670dc2448696bfeb02b38de6d3","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.10.0.tgz","fileCount":24,"integrity":"sha512-MTpChyPKrsp8TSIVXPyXhpCJgMwehagARLGj/6/bL2UAn0K+zTXdS6eHpKxWOPslMpZZd7Niw0j/4o/p/NjXtg==","signatures":[{"sig":"MEUCIAXHZT6KSOTU7yHAO2aLBvr5Y2euRklQYhwhoMFMKm7NAiEA/yzbjNtWbkxbXPX1LPJl7+R7zA8n5L0VbumkOnOjiho=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.10.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":107591},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./rpc":{"types":"./dist/rpc/index.d.ts","default":"./dist/rpc/index.js"},"./pubsub":{"types":"./dist/pubsub/index.d.ts","default":"./dist/pubsub/index.js"},"./messaging":{"types":"./dist/messaging/index.d.ts","default":"./dist/messaging/index.js"}},"funding":{"url":"https://github.com/sponsors/koistya","type":"github"},"gitHead":"b0a32263ddc6a0b9a54084519304f0bbb478538f","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1980e364-0774-4429-bb1b-85ed1d855874"}},"repository":{"url":"git+https://github.com/kriasoft/ws-kit.git","type":"git","directory":"packages/plugins"},"_npmVersion":"11.6.2","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"^0.10.0"},"peerDependencies":{"@ws-kit/core":"^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/plugins_0.10.0_1764943200936_0.4873174784935217","host":"s3://npm-registry-packages-npm-production"}},"0.10.1":{"name":"@ws-kit/plugins","version":"0.10.1","description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","type":"module","sideEffects":false,"license":"MIT","author":{"name":"Konstantin Tarkus"},"homepage":"https://kriasoft.com/ws-kit/","bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"repository":{"type":"git","url":"git+https://github.com/kriasoft/ws-kit.git","directory":"packages/plugins"},"funding":{"type":"github","url":"https://github.com/sponsors/koistya"},"keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./messaging":{"types":"./dist/messaging/index.d.ts","default":"./dist/messaging/index.js"},"./rpc":{"types":"./dist/rpc/index.d.ts","default":"./dist/rpc/index.js"},"./pubsub":{"types":"./dist/pubsub/index.d.ts","default":"./dist/pubsub/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","peerDependencies":{"@ws-kit/core":"^0.10.0"},"devDependencies":{"@types/bun":"^1.3.3","@ws-kit/core":"^0.10.0"},"engines":{"node":">=22"},"publishConfig":{"access":"public"},"gitHead":"ae81d17456776d492cd462c510166ab145176e8a","_id":"@ws-kit/plugins@0.10.1","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-yYl4+4im+UM3733XnGw2qQGYQ53GOs/TGkHSIhClVLVMU5wZfR2hjNc73NIQMVkMEsVrWrEgPfPsf7sRTyzPgQ==","shasum":"c1a0391fc0ef13876d8910ef6212473a7066c5de","tarball":"https://registry.npmjs.org/@ws-kit/plugins/-/plugins-0.10.1.tgz","fileCount":24,"unpackedSize":108331,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ws-kit%2fplugins@0.10.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICgh+NawCTiDUCFlC9bhRxqo2ID085SbWNToSqmm9BYNAiBYBnlFeInMIrXhe/Ufe2vzjz2tnTj0Hv8BgCEJM15n6w=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1980e364-0774-4429-bb1b-85ed1d855874"}},"directories":{},"maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugins_0.10.1_1764946397138_0.16129280462868256"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-30T22:29:48.876Z","modified":"2025-12-05T14:53:17.690Z","0.7.0":"2025-11-30T22:29:49.163Z","0.8.0":"2025-12-01T00:06:50.423Z","0.8.1":"2025-12-01T00:47:50.348Z","0.9.0":"2025-12-04T22:00:21.912Z","0.10.0":"2025-12-05T14:00:01.126Z","0.10.1":"2025-12-05T14:53:17.276Z"},"bugs":{"url":"https://github.com/kriasoft/ws-kit/issues"},"author":{"name":"Konstantin Tarkus"},"license":"MIT","homepage":"https://kriasoft.com/ws-kit/","keywords":["websocket","plugin","messaging","rpc","pubsub","pub-sub","broadcasting","type-safe","typescript"],"repository":{"type":"git","url":"git+https://github.com/kriasoft/ws-kit.git","directory":"packages/plugins"},"description":"Core plugins for WS-Kit routers (messaging, RPC, pub/sub)","maintainers":[{"name":"koistya","email":"hello@tarkus.me"},{"name":"kriasoft-bot","email":"kriasoft@gmail.com"}],"readme":"# @ws-kit/plugins\n\nCore plugins for WS-Kit routers — framework features that add capabilities via composition.\n\n## Plugins\n\n- **`withMessaging()`** — Fire-and-forget unicast messaging (`ctx.send()`)\n- **`withRpc()`** — Request-response with streaming (`ctx.reply()`, `ctx.progress()`)\n- **`withPubSub(options)`** — Topic-based broadcasting (`ctx.publish()`, `ctx.topics`)\n\n## Installation\n\n```bash\nbun add @ws-kit/plugins\n```\n\n## Quick Start\n\n```typescript\nimport { createRouter, withZod } from \"@ws-kit/zod\";\nimport { withPubSub, withRpc } from \"@ws-kit/plugins\";\nimport { memoryPubSub } from \"@ws-kit/memory\";\n\nconst router = createRouter()\n  .plugin(withZod()) // Validation\n  .plugin(withRpc()) // Request-response\n  .plugin(\n    withPubSub({\n      adapter: memoryPubSub(), // In-memory pub/sub (dev)\n    }),\n  );\n\n// Handlers now have:\n// - ctx.send() — fire-and-forget\n// - ctx.publish() — broadcast to topic\n// - ctx.reply(), ctx.progress() — RPC responses\n```\n\n## Architecture\n\n**Plugins** define framework features; **adapters** provide backend implementations:\n\n- **Memory** (in `@ws-kit/memory`) — For development and testing\n- **Redis** (in `@ws-kit/redis`) — For distributed deployments\n- **Cloudflare** (in `@ws-kit/cloudflare`) — For Cloudflare Workers\n\nSwap adapters without changing your code:\n\n```typescript\n// Development\n.plugin(withPubSub({ adapter: memoryPubSub() }))\n\n// Production\n.plugin(withPubSub({ adapter: redisPubSub(redis) }))\n```\n\n## Convenience Re-exports\n\nFor convenience, validator packages re-export these plugins:\n\n```typescript\n// ✅ Convenient (recommended)\nimport { withPubSub, withRpc } from \"@ws-kit/zod\";\n\n// ✅ Also works (explicit)\nimport { withPubSub, withRpc } from \"@ws-kit/plugins\";\n```\n\n## Documentation\n\n- **[docs/specs/plugins.md](../../docs/specs/plugins.md)** — Complete plugin documentation\n- **[ADR-031: Plugin-Adapter Architecture](../../docs/adr/031-plugin-adapter-architecture.md)** — Design rationale\n- **[docs/specs/context-methods.md](../../docs/specs/context-methods.md)** — Context method API reference\n\n## TypeScript\n\nAll plugins are fully typed. The type system enforces that:\n\n- Methods only appear after their plugin is registered\n- Context is properly enhanced with plugin methods\n- Payloads match schema types\n\n## License\n\nMIT\n","readmeFilename":"README.md"}