{"_id":"@alyvro/pulse","_rev":"3-da8f5dbb627d88973b8dcb7411ae76f2","name":"@alyvro/pulse","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@alyvro/pulse","version":"1.0.0","keywords":["nextjs","serverless","realtime"],"author":{"url":"https://alyvro.com","name":"Alyvro","email":"info@alyvro.com"},"license":"MIT","_id":"@alyvro/pulse@1.0.0","maintainers":[{"name":"this_nima","email":"nimastrong852@gmail.com"}],"dist":{"shasum":"ca30c771fd1591d4ff3f5395b974f311f9124007","tarball":"https://registry.npmjs.org/@alyvro/pulse/-/pulse-1.0.0.tgz","fileCount":15,"integrity":"sha512-T5a/5lJvUbmDkVnzjqW7FjUFbAaODcGSDwvy++LOE6DMgt1BFI7pP82/5FVCUUVa+lS3kSeKNl4XkBqZvv303A==","signatures":[{"sig":"MEQCIETjKsPy0if1QzUpQtQvLm8Mm9kWEqB534Ggim/ar/SqAiAl3yFU5RFF2fofN3zEC1AEyNiiH7KHfOrS5jhV1IjpXg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32689},"type":"module","_from":"file:alyvro-pulse-1.0.0.tgz","exports":{"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup"},"_npmUser":{"name":"this_nima","email":"nimastrong852@gmail.com"},"_resolved":"C:\\Users\\nimas\\AppData\\Local\\Temp\\4693eee50ab48f5f44240c643d134950\\alyvro-pulse-1.0.0.tgz","_integrity":"sha512-T5a/5lJvUbmDkVnzjqW7FjUFbAaODcGSDwvy++LOE6DMgt1BFI7pP82/5FVCUUVa+lS3kSeKNl4XkBqZvv303A==","_npmVersion":"10.9.2","description":"Real-time SSE with custom Alyvro Protocol.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"nanoid":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"next":"^16.1.6","tsup":"^8.0.0","jsdom":"^28.0.0","nanoid":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^19.2.14","@testing-library/react":"^16.3.2"},"peerDependencies":{"next":"^16.1.6","react":">=18"},"_npmOperationalInternal":{"tmp":"tmp/pulse_1.0.0_1770994995728_0.6802006172628883","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alyvro/pulse","version":"1.0.1","keywords":["nextjs","serverless","realtime"],"author":{"url":"https://alyvro.com","name":"Alyvro","email":"info@alyvro.com"},"license":"MIT","_id":"@alyvro/pulse@1.0.1","maintainers":[{"name":"this_nima","email":"nimastrong852@gmail.com"}],"homepage":"https://github.com/alyvro/pulse#readme","bugs":{"url":"https://github.com/alyvro/pulse/issues"},"dist":{"shasum":"61633f7093b9fb18dbbc2abb8d2382dd2acd4a67","tarball":"https://registry.npmjs.org/@alyvro/pulse/-/pulse-1.0.1.tgz","fileCount":15,"integrity":"sha512-SHgALBoAAO/yx2r6aMyb+NIhP4+bMy6lMOyEcJVu2ocMlS4B+Ej0oG0gaW3iDETG/nj46NXCUTaJHXnP6CHefw==","signatures":[{"sig":"MEUCIHEjKetlt/8g4FB2PSJGpU14rQnE2CEBqEEttqmf6Bp5AiEAudJp8X1eJm4t3QlZzZvlSBNMzfGe5IS//WNWdTecScA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32776},"type":"module","_from":"file:alyvro-pulse-1.0.1.tgz","exports":{"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup"},"_npmUser":{"name":"this_nima","email":"nimastrong852@gmail.com"},"_resolved":"C:\\Users\\nimas\\AppData\\Local\\Temp\\8519381543746e87ba91f322c1174de6\\alyvro-pulse-1.0.1.tgz","_integrity":"sha512-SHgALBoAAO/yx2r6aMyb+NIhP4+bMy6lMOyEcJVu2ocMlS4B+Ej0oG0gaW3iDETG/nj46NXCUTaJHXnP6CHefw==","repository":{"url":"git+https://github.com/alyvro/pulse.git","type":"git"},"_npmVersion":"10.9.2","description":"Real-time SSE with custom Alyvro Protocol.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"nanoid":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"next":"^16.1.6","tsup":"^8.0.0","jsdom":"^28.0.0","nanoid":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^19.2.14","@testing-library/react":"^16.3.2"},"peerDependencies":{"next":"^16.1.6","react":">=18"},"_npmOperationalInternal":{"tmp":"tmp/pulse_1.0.1_1770995192159_0.05506498856015041","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alyvro/pulse","version":"1.0.2","description":"Real-time SSE with custom Alyvro Protocol.","type":"module","exports":{"./client":{"import":"./dist/client/index.js","types":"./dist/client/index.d.ts"},"./server":{"import":"./dist/server/index.js","types":"./dist/server/index.d.ts"}},"keywords":["nextjs","serverless","realtime"],"author":{"name":"Alyvro","email":"info@alyvro.com","url":"https://alyvro.com"},"repository":{"type":"git","url":"git+https://github.com/alyvro/pulse.git"},"license":"MIT","peerDependencies":{"next":"^16.1.6","react":">=18"},"devDependencies":{"@testing-library/react":"^16.3.2","@types/node":"^20.0.0","@types/react":"^19.2.14","jsdom":"^28.0.0","nanoid":"^5.0.0","next":"^16.1.6","tsup":"^8.0.0","typescript":"^5.0.0","vitest":"^1.0.0"},"dependencies":{"nanoid":"^5.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run"},"_id":"@alyvro/pulse@1.0.2","bugs":{"url":"https://github.com/alyvro/pulse/issues"},"homepage":"https://github.com/alyvro/pulse#readme","_integrity":"sha512-myHtp1JhjbAuhJ9DcDu/83am+LOCDRNF1hODe1+rIZIdjPD7rDQXw/ETpryegwT7gMsufTBT6yzMZExJr5kK/Q==","_resolved":"C:\\Users\\nimas\\AppData\\Local\\Temp\\d45461009aa368b45de36f95d1cd52bf\\alyvro-pulse-1.0.2.tgz","_from":"file:alyvro-pulse-1.0.2.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-myHtp1JhjbAuhJ9DcDu/83am+LOCDRNF1hODe1+rIZIdjPD7rDQXw/ETpryegwT7gMsufTBT6yzMZExJr5kK/Q==","shasum":"f51e5c342420860b424c0b7b41124c1ae00a9f55","tarball":"https://registry.npmjs.org/@alyvro/pulse/-/pulse-1.0.2.tgz","fileCount":15,"unpackedSize":32964,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCG2no3/HVodwe9saBdg/xXi2STP3YjDG6hY8XGVw6ZxgIgX/SJMoxqVVZieZJOhZI+NKIYRGGy9iuhugZ3si8GYnQ="}]},"_npmUser":{"name":"this_nima","email":"nimastrong852@gmail.com"},"directories":{},"maintainers":[{"name":"this_nima","email":"nimastrong852@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pulse_1.0.2_1770995826491_0.6710073437297934"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-13T15:03:15.658Z","modified":"2026-02-13T15:17:06.769Z","1.0.0":"2026-02-13T15:03:15.894Z","1.0.1":"2026-02-13T15:06:32.294Z","1.0.2":"2026-02-13T15:17:06.643Z"},"bugs":{"url":"https://github.com/alyvro/pulse/issues"},"author":{"name":"Alyvro","email":"info@alyvro.com","url":"https://alyvro.com"},"license":"MIT","homepage":"https://github.com/alyvro/pulse#readme","keywords":["nextjs","serverless","realtime"],"repository":{"type":"git","url":"git+https://github.com/alyvro/pulse.git"},"description":"Real-time SSE with custom Alyvro Protocol.","maintainers":[{"name":"this_nima","email":"nimastrong852@gmail.com"}],"readme":"# @alyvro/pulse ⚡\r\n\r\n**The Serverless Real-time Protocol.**\r\nA lightweight, secure, and type-safe real-time communication layer built specifically for Next.js App Router and Edge Runtimes.\r\n\r\nUnlike WebSockets which are hard to manage in serverless environments, Pulse uses a custom wire protocol (**APWP**) over HTTP Streaming (SSE) to deliver data instantly.\r\n\r\n## ✨ Features\r\n\r\n- **Serverless Ready:** Works perfectly on Vercel, Cloudflare Workers, and Docker.\r\n- **Zero-Config:** No external WebSocket server needed.\r\n- **Type-Safe:** Full TypeScript support from server to client.\r\n- **Multiplexing:** Single connection handles multiple channels.\r\n\r\n---\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\npnpm add @alyvro/pulse nanoid\r\n```\r\n\r\n---\r\n\r\n## 🚀 Quick Start\r\n\r\n### 1. Setup the Server Handler\r\n\r\nCreate a route handler in app/api/pulse/route.ts.\r\n\r\n```ts\r\nimport { pulse } from \"@alyvro/pulse/server\";\r\n\r\nexport const GET = pulse.Handler();\r\n```\r\n\r\n### 2. Connect in Client\r\n\r\nUse the hook to listen to a specific channel.\r\n\r\n```tsx\r\n\"use client\";\r\nimport { usePulse } from \"@alyvro/pulse/client\";\r\n\r\nexport default function RealTimeCounter() {\r\n  const { data, status } = usePulse<{ count: number }>(\"counter\");\r\n\r\n  if (status === \"CONNECTING\") return <p>Connecting...</p>;\r\n\r\n  return <h1>Count: {data?.count ?? 0}</h1>;\r\n}\r\n```\r\n\r\n### 3. Emit Data (Server Action)\r\n\r\nTrigger updates from anywhere (Server Actions, API Routes, Cron Jobs).\r\n\r\n```ts\r\n\"use server\";\r\nimport { pulse } from \"@alyvro/pulse/server\";\r\n\r\nexport async function increment() {\r\n  // Logic...\r\n  pulse.emit(\"counter\", { count: 101 });\r\n}\r\n```\r\n\r\n---\r\n\r\n## 📄 License\r\n\r\nMIT © [Alyvro](https://github.com/alyvro)\r\n","readmeFilename":"README.md"}