The Deepgram JavaScript SDK is the official TypeScript-based SDK for integrating Deepgram's speech recognition, text-to-speech, and language understanding APIs into JavaScript and TypeScript applications. Built with Fern and distributed via npm, the SDK enables developers to add world-class speech and language AI capabilities to their applications with support for Node.js 18 and higher.
The SDK provides comprehensive client implementations for multiple use cases. Real-time speech recognition connects to Deepgram's WebSocket infrastructure for live audio transcription, while file transcription handles pre-recorded audio processing. Text-to-speech functionality generates natural-sounding speech from text input, and text analysis capabilities evaluate sentiment, topics, and intents. The SDK also includes support for voice agents that enable conversational AI interactions, allowing developers to build interactive voice-based applications.
Authentication is handled through two primary methods: API key authentication for server-side applications and access token authentication for temporary or scoped access, with the latter recommended for client-side use. The SDK automatically discovers credentials from environment variables, specifically DEEPGRAM_ACCESS_TOKEN and DEEPGRAM_API_KEY, with explicit parameters taking precedence over environment variables. Developers can obtain a free API key through the Deepgram console.
Browser compatibility is a notable feature, with full support for WebSocket-based functionality including live transcription, voice agents, and live text-to-speech through direct connections to Deepgram's WebSocket endpoints. REST API features in browsers require a proxy server due to CORS restrictions, with the SDK supporting custom proxy configuration through baseUrl parameters. The SDK maintains runtime compatibility across multiple environments including Node.js, Vercel, Cloudflare Workers, Deno v1.25 and higher, Bun 1.0 and higher, and React Native.
The repository shows active maintenance and community engagement. GitGenius tracking data reveals a median issue and pull request response latency of 7.0 hours across 78 tracked items, with mean latency of 348.0 hours. The most active labels tracked are work-in-progress with 15 occurrences, beta with 13, and bug reports with 12. Primary contributors include lukeocodes with 113 tracked events, naomi-deepgram with 50 events, and jpvajda with 40 events. The repository shares overlapping contributors with apollographql/apollo-client, deepgram/deepgram-python-sdk, and microsoft/vscode, indicating cross-project collaboration within the developer ecosystem.
The SDK exports all request and response types as TypeScript interfaces, providing strong type safety for developers. Advanced features include configurable request options for timeouts and retries, access to raw response data, support for custom fetch implementations in unsupported environments, and built-in logging capabilities. The project maintains backwards compatibility with older SDK versions receiving Priority 1 bug support, while security issues and significant bugs without clear workarounds receive priority attention. The SDK includes migration guides for upgrading from v2 to v3, v3 to v4, and v4 to v5, with v5 being the current version. Development setup involves standard npm-based workflows with dependency installation, building, and testing. The project is licensed under the MIT License and welcomes community contributions through GitHub issues, Discord, and GitHub Discussions.