{"id":48882151,"url":"https://github.com/agenisea/sse-kit","last_synced_at":"2026-04-16T03:33:49.099Z","repository":{"id":330924404,"uuid":"1124406463","full_name":"agenisea/sse-kit","owner":"agenisea","description":"Server-Sent Events streaming — server and client kit for TypeScript.","archived":false,"fork":false,"pushed_at":"2025-12-29T20:30:04.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T23:49:20.034Z","etag":null,"topics":["sse","streaming","streaming-library","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/agenisea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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}},"created_at":"2025-12-29T01:04:49.000Z","updated_at":"2025-12-30T01:42:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agenisea/sse-kit","commit_stats":null,"previous_names":["agenisea/sse-kit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/agenisea/sse-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenisea%2Fsse-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenisea%2Fsse-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenisea%2Fsse-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenisea%2Fsse-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agenisea","download_url":"https://codeload.github.com/agenisea/sse-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenisea%2Fsse-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31870513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["sse","streaming","streaming-library","typescript","typescript-library"],"created_at":"2026-04-16T03:33:48.420Z","updated_at":"2026-04-16T03:33:49.074Z","avatar_url":"https://github.com/agenisea.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/agenisea/sse-kit/main/assets/logo.png\" alt=\"sse-kit logo\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n# @agenisea/sse-kit\n\nServer-Sent Events streaming for TypeScript. Zero dependencies. Works with Next.js, Express, Hono, and any runtime that supports ReadableStream.\n\n## Features\n\n- **Server orchestration** — heartbeat, abort signals, observability hooks\n- **Client parsing** — stateful chunked and full response modes\n- **Resilience** — exponential backoff, circuit breaker, timeouts\n- **React hook** — full lifecycle management with retry support\n- **Tree-shakeable** — import only what you need\n\n## Design Philosophy\n\n`event:` = protocol (stream lifecycle). `data:` = application (your data, any shape).\n\nsse-kit is a pure transport layer. The SSE `event:` line drives state transitions. The `data:` line carries your payload — no wrappers, no reshaping. What you send is what you get.\n\n## Install\n\n```bash\npnpm add @agenisea/sse-kit\n```\n\n## Quick Start\n\n### Server\n\n```typescript\nimport { createStreamingResponse, createSSEResponse } from '@agenisea/sse-kit/server'\n\nexport async function POST(request: Request) {\n  const { stream, orchestrator } = createStreamingResponse({\n    signal: request.signal,\n    heartbeat: { intervalMs: 3000, enabled: true }, // default: 5000ms\n  })\n\n  ;(async () =\u003e {\n    orchestrator.startHeartbeat()\n    await orchestrator.sendUpdate('stage', { name: 'parsing', status: 'running' })\n    await orchestrator.sendData({ sections: 12, title: 'Report' })\n    await orchestrator.close()\n  })()\n\n  return createSSEResponse(stream)\n}\n```\n\n### Client\n\n```typescript\nimport { useSSEStream } from '@agenisea/sse-kit/client'\n\nfunction App() {\n  const { state, start, cancel } = useSSEStream({\n    endpoint: '/api/stream',\n    initialEvent: 'idle',\n    completeEvent: 'complete',\n    errorEvent: 'error',\n    onUpdate: (event, data) =\u003e {\n      if (event === 'stage') console.log('Stage:', data)\n    },\n    onComplete: (result) =\u003e console.log('Done:', result),\n    onError: (error) =\u003e console.error('Error:', error),\n  })\n\n  return (\n    \u003cbutton onClick={() =\u003e start({ query: 'test' })}\u003e\n      {state.isStreaming ? 'Streaming...' : 'Start'}\n    \u003c/button\u003e\n  )\n}\n```\n\n## Documentation\n\n- [API Reference](./docs/API.md) — full API documentation\n- [Security](./docs/SECURITY.md) — security considerations\n- [Changelog](./CHANGELOG.md) — version history\n\n## License\n\nMIT\n\n---\n\n*Built by [Agenisea](https://agenisea.ai)*\n\n---\n\n\u0026copy; 2025-2026 Patrick Pena / Agenisea\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenisea%2Fsse-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagenisea%2Fsse-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenisea%2Fsse-kit/lists"}