{"id":51027211,"url":"https://github.com/deepgram/react","last_synced_at":"2026-06-21T20:30:49.560Z","repository":{"id":355778851,"uuid":"1209772020","full_name":"deepgram/react","owner":"deepgram","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-05T01:20:35.000Z","size":81,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-05T08:42:41.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/deepgram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/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":"2026-04-13T19:07:31.000Z","updated_at":"2026-04-30T20:28:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deepgram/react","commit_stats":null,"previous_names":["deepgram/react"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/deepgram/react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Freact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Freact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Freact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Freact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepgram","download_url":"https://codeload.github.com/deepgram/react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Freact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34625624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"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":[],"created_at":"2026-06-21T20:30:48.460Z","updated_at":"2026-06-21T20:30:49.544Z","avatar_url":"https://github.com/deepgram.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @deepgram/react\n\n[![npm version](https://img.shields.io/npm/v/@deepgram/react.svg)](https://www.npmjs.com/package/@deepgram/react)\n[![license](https://img.shields.io/npm/l/@deepgram/react.svg)](LICENSE)\n[![CI](https://github.com/deepgram/react/actions/workflows/ci.yml/badge.svg)](https://github.com/deepgram/react/actions/workflows/ci.yml)\n\nReact hooks and provider for the [Deepgram Voice Agent API](https://developers.deepgram.com/docs/voice-agent). Manages connection lifecycle, microphone capture, audio playback, conversation state, and mode tracking.\n\n## Install\n\n```bash\nnpm install @deepgram/react @deepgram/agents\n```\n\n## Quick Start\n\n```tsx\nimport { AgentProvider, useAgentState, useAgentConversation } from \"@deepgram/react\";\n\nfunction App() {\n  return (\n    \u003cAgentProvider\n      config={{\n        auth: { tokenFactory: () =\u003e fetch('/api/deepgram-token').then(r =\u003e r.text()) },\n        agent: { think: { provider: { type: 'open_ai' }, model: 'gpt-4o-mini' } },\n      }}\n    \u003e\n      \u003cVoiceAgent /\u003e\n    \u003c/AgentProvider\u003e\n  );\n}\n\nfunction VoiceAgent() {\n  const { state, start, stop } = useAgentState();\n  const { conversation } = useAgentConversation();\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={state === \"idle\" ? start : stop}\u003e\n        {state === \"idle\" ? \"Start\" : \"Stop\"}\n      \u003c/button\u003e\n      {conversation.map((entry) =\u003e (\n        \u003cp key={entry.id}\u003e\u003cb\u003e{entry.role}:\u003c/b\u003e {entry.content}\u003c/p\u003e\n      ))}\n    \u003c/div\u003e\n  );\n}\n```\n\n## Hooks\n\n| Hook | Purpose |\n|------|---------|\n| `useAgentState` | Connection state (`idle`, `connecting`, `connected`, etc.) and `start`/`stop` controls |\n| `useAgentMode` | Speaking/listening mode tracking |\n| `useAgentConversation` | Conversation transcript and `sendUserMessage` |\n| `useAgentMicrophone` | Mic state, mute controls, input volume |\n| `useAgentPlayer` | Audio playback state, mute controls, output volume |\n| `useAgentControls` | Stable action methods (never change identity) |\n| `useAgentClientTool` | Register client-side function call handlers scoped to component lifecycle |\n| `useAgentSession` | Direct access to the underlying `AgentSession` (escape hatch) |\n| `useDeepgramAgent` | Standalone hook -- no provider needed |\n\nSee the [package README](packages/react/README.md) for full API documentation.\n\n## Related Packages\n\n| Package | Repo | Description |\n|---------|------|-------------|\n| [`@deepgram/agents`](https://github.com/deepgram/agent) | `deepgram/agent` | Core SDK -- WebSocket session, microphone capture, audio playback |\n| [`@deepgram/ui`](https://github.com/deepgram/ui) | `deepgram/ui` | Pre-built React UI components with Tailwind CSS theming |\n| [`@deepgram/agents-widget`](https://github.com/deepgram/agent) | `deepgram/agent` | Self-contained widget (UMD + ESM) |\n\n## Documentation\n\n- [Deepgram Voice Agent docs](https://developers.deepgram.com/docs/voice-agent)\n- [API reference](https://developers.deepgram.com/reference)\n- [`@deepgram/ui` -- pre-built components](https://github.com/deepgram/ui)\n\n## Development\n\n**Prerequisites:** [Bun](https://bun.sh/) 1.3+\n\nThis package depends on `@deepgram/agents` via a `file:` pointer. Clone the agent repo as a sibling:\n\n```bash\ngit clone git@github.com:deepgram/agent.git ../agent\ncd ../agent \u0026\u0026 bun install \u0026\u0026 bun run build\n```\n\nThen:\n\n```bash\ngit clone git@github.com:deepgram/react.git\ncd react\nbun install\n```\n\n```bash\nbun run build       # Build @deepgram/react\nbun run typecheck   # Type-check\nbun run test        # Run tests\nbun run dev         # Watch-build\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](.github/CONTRIBUTING.md) for development setup and guidelines.\n\n## License\n\nMIT -- see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Freact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepgram%2Freact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Freact/lists"}