-
Notifications
You must be signed in to change notification settings - Fork 81
refactor!: regenerate SDK with Fern code generator #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR is an automated code regeneration from Fern based on the latest API Definition, dated November 10, 2025. The changes introduce new API client structures and types across multiple Deepgram API endpoints.
Key changes:
- Added new Read API v1 text analysis capabilities with support for summarization, sentiment, topics, and intents
- Introduced Listen API v2 with streaming support and turn-based conversation features
- Expanded Management API with comprehensive project, billing, and usage tracking endpoints
- Added Authentication API v1 for token management
Reviewed Changes
Copilot reviewed 295 out of 723 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/api/resources/read/** |
New Read API v1 structure for text analysis with various configuration types and client implementations |
src/api/resources/listen/resources/v2/** |
New Listen API v2 with WebSocket support for streaming transcription and turn-based interactions |
src/api/resources/manage/** |
Comprehensive Management API v1 for projects, keys, members, models, usage, billing, and requests |
src/api/resources/listen/resources/v1/** |
Expanded Listen API v1 with media transcription types and request interfaces |
src/api/resources/auth/** |
New Authentication API v1 for token grant operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add 24 manual test scripts covering all major SDK features - Include tests for Listen (v1/v2), Speak, Read, and Agent APIs - Each endpoint has 3 test variants: basic, with auth token, and with raw response - Tests use locally built SDK from dist/cjs for validation - Add fixtures (audio.mp3, audio.wav) for file-based tests - Add comprehensive README with setup and usage instructions - Update .fernignore to exclude manual tests from Fern modifications Tests are simple Node.js scripts requiring DEEPGRAM_API_KEY environment variable. All tests complete without user interaction using async/await patterns.
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Add standalone Playwright browser test that validates the SDK works in browser environments. The test uses webpack to bundle the SDK for browser compatibility, removing Node.js dependencies. - Creates browser-standalone.js that builds SDK bundle on-the-fly - Includes browser-standalone.html template with API key placeholder - Tests transcribeUrl method with remote audio file - Handles expected CORS errors gracefully - Validates SDK loads and executes correctly in headless Chromium
Add standalone Playwright browser test for file upload transcription. This test validates the SDK can handle binary audio data in browser environments. - Creates browser-standalone.js that builds SDK bundle with webpack - Includes browser-standalone.html template for file-based transcription - Fetches audio file via HTTP and converts to ArrayBuffer - Tests transcribeFile method with local audio file - Runs on port 8766 to avoid conflicts with transcribeUrl test - Validates file reading, upload, and API interaction in browser
Create reusable utilities for Playwright-based browser testing of the SDK. This module provides common functionality for all browser tests. Features: - buildBrowserBundle(): Webpack bundling with Node.js dependency exclusion - createServer(): HTTP server with custom route support - prepareHtmlTemplate(): Template processing with placeholder replacement - launchBrowserTest(): Playwright browser initialization - waitForTestResult(): Test execution and result collection - evaluateTestResult(): Result evaluation with CORS error handling - cleanup(): Resource cleanup (files, server, browser) - runBrowserTest(): Complete test orchestration This abstraction enables consistent browser testing across all SDK methods while eliminating code duplication.
Refactor transcribeUrl and transcribeFile browser tests to use the new shared browser-test-utils module, eliminating code duplication. Changes: - transcribeUrl test: Reduced from 248 to 16 lines (93% reduction) - transcribeFile test: Reduced from 261 to 46 lines (82% reduction) - Both tests now use runBrowserTest() orchestration function - transcribeFile includes custom file handler for audio fixtures - Overall code reduction: 509 lines -> 426 lines (16% improvement) Benefits: - Single source of truth for browser testing infrastructure - Easier maintenance and bug fixes - Consistent behavior across all browser tests - Simple template for adding new browser tests
Add comments to .fernignore explaining why specific files are excluded: - Manual test directory used in development - Custom README modifications - Custom websocket reference documentation
Add comprehensive WebSocket API reference documentation covering: - Listen V1 WebSocket connections for live transcription - Speak V1 WebSocket connections for text-to-speech streaming - Agent V1 WebSocket connections for voice agent functionality This complements the main reference.md with detailed WebSocket-specific documentation.
Simplify README from 729 to 32 lines by: - Removing extensive inline API documentation - Adding clear references to reference.md and websockets-reference.md - Focusing on quick start and authentication basics - Maintaining links to migration guides and usage examples Full API documentation now lives in dedicated reference files.
- Add manual tests for agent/v1/settings/think/models API - Add manual tests for auth/v1/tokens API - Add manual tests for manage/v1/models API - Add manual tests for manage/v1/projects and nested resources - Add manual tests for selfHosted/v1/distributionCredentials API - All tests include TypeScript JSDoc annotations - Tests use simplified DeepgramClient() constructor - Tests re-throw errors for proper exit codes
- Add TypeScript JSDoc annotations to all existing manual tests - Simplify client constructors to use environment variables - Improve error handling to re-throw exceptions - Remove with_auth_token and with_raw_response test variants
- Add run_examples.sh script to execute all manual tests - Automatically builds SDK if not already built - Exits on first test failure - Validates DEEPGRAM_API_KEY is configured
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up node | ||
| uses: actions/setup-node@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Test | ||
| run: pnpm test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 27 days ago
To address the issue, add a permissions block at the root of the workflow file (.github/workflows/ci.yml) to restrict the GitHub Actions token. Since none of the jobs require write access (they just check out code, install dependencies, build, and run tests), the minimal permission contents: read suffices. Place this permissions entry beneath the name: and on: keys but above jobs:. No additional imports, dependencies, or code changes are required.
-
Copy modified lines R4-R5
| @@ -1,6 +1,8 @@ | ||
| name: ci | ||
|
|
||
| on: [push] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| compile: |
Description
This PR represents a complete regeneration of the Deepgram JavaScript SDK using the Fern code generation framework. This is a major architectural change that modernizes the SDK structure and improves maintainability.
Type of Change
Key Changes
SDK Architecture
agent- AI Agent APIsauth- Authentication/token managementlisten- Speech-to-text (v1 and v2)manage- Project and account managementread- Text analysisselfHosted- Self-hosted/on-prem credentialsspeak- Text-to-speechBreaking Changes
Checklist
Notes
This regeneration was performed by Fern's code generation tooling and represents the foundation for future SDK development. Examples and additional documentation will be added in follow-up PRs.