deepgram-js-maintaining-sdk
Maintaining the Deepgram JavaScript / TypeScript SDK
This SDK is generated by Fern. Most files under src/ are auto-generated and should not be edited directly. Some files are hand-written or protected in .fernignore so Fern does not overwrite them.
When a new Fern generator release is available, prepare the repo so Fern can replace generated output, then re-apply any still-needed manual work after reviewing the diff.
Freeze classification rules
Every entry in .fernignore falls into one of two categories. The comment above the entry is the first clue, but use these rules when in doubt.
Never unfreeze (permanently frozen)
These files are entirely hand-written or repo-maintained. Fern should never own them.
How to identify:
- The file was created by Deepgram, not by Fern (
src/CustomClient.ts, curated exports, helper scripts, hand-written tests). - The file is documentation, tooling, config, or examples managed outside generator output.
- The file lives outside
src/api/or deliberately wraps generated code.
Current permanently frozen entries from .fernignore / AGENTS.md:
src/CustomClient.ts— custom wrapper for auth prefixing, session ID propagation, browser/Node WebSocket handling, reconnect behavior, binary message fixes, andcreateConnection()aliasessrc/index.ts— curated re-exports with backwards-compatible namespace behaviorscripts/fix-wire-test-imports.js,scripts/revert-wire-test-imports.js— post-generation import fixupsscripts/proxy-server.js— development proxyscripts/validate-esm-build.mjs— ESM build validationwebpack.config.js— browser bundle configtests/browser/— browser-specific suitetests/esm-build.test.ts— ESM validation testtests/unit/*— hand-written unit teststests/wire/websocket/— hand-written websocket wire teststests/wire/listen/v1/transcription.test.ts— hand-written wire testvitest.config.mts— test configMakefile— developer command runnerMIGRATION_GUIDE_V4_TO_V5.md— migration docsREADME.md,CHANGELOG.md,docs/,examples/— repo docs and examples.npmignore,.gitignore,.npmrc,.github/— package/repo configCLAUDE.md,AGENTS.md,.claude/,.agents/,.mcp.json— agent/tooling files
Unfreeze for regen (temporarily frozen)
These are generated files with local patches. They stay frozen between regens, but should be temporarily swapped to .bak during a regen prep so Fern can overwrite the original path.
How to identify:
- Fern would recreate the file if it were removed.
- Your current copy is a patched version of generator output, not a fully hand-written file.
Current temporarily frozen entries:
- None right now.
AGENTS.mdexplicitly says all current.fernignoreentries are permanently frozen.
If you patch a generated file in the future, add it to .fernignore with a comment explaining the patch and update this skill plus AGENTS.md.
Prepare repo for regeneration
- Create a branch from
mainnamedlo/sdk-gen-<YYYY-MM-DD>. - Push it and open a PR titled
chore: SDK regeneration <YYYY-MM-DD>. - Read
.fernignoreand classify every entry. - For each temporarily frozen file only:
- copy it to
<filename>.bakbeside the original - replace the original path in
.fernignorewith the.bakpath
- copy it to
- Leave permanently frozen entries untouched.
- Commit as
chore: unfreeze files pending regenand push.
After regeneration
- Diff each
.bakfile against the newly generated original. - Re-apply only the patches that are still needed.
- Change
.fernignoreentries from.bakback to the original path for files that still need freezing. - Remove
.fernignoreentries entirely for files where the generator is now correct. - Delete the
.bakfiles. - Run verification.
- Commit as
chore: re-apply manual patches after regenand push.
Verification commands
Repo guidance in AGENTS.md says:
make build && make test && make lint
Package scripts in package.json resolve to:
pnpm build
pnpm test
pnpm lint
pnpm check
Relevant underlying commands today:
pnpm build→tsc --project ./tsconfig.cjs.json+tsc --project ./tsconfig.esm.json+ ESM rename scriptpnpm test→vitestpnpm lint/pnpm check→ Biome lint/check
JS-specific maintainer notes
- Do not edit most generated files under
src/api/directly. Prefer Fern input changes or post-regen patch review. src/CustomClient.tsis the highest-risk permanent wrapper. It carries auth prefixing, browser subprotocol auth, custom websocket startup, binary handling, and the user-facingcreateConnection()aliases used by examples.- The repo ships both CJS and ESM. Validate both outputs after generator changes.
- Browser behavior matters. The wrapper intentionally diverges for browser WebSocket auth because browsers cannot send arbitrary socket headers.
.agents/is permanently frozen in.fernignore. Treat these skills as hand-written documentation during regeneration; Fern will not touch the folder. Keep this note aligned withAGENTS.mdwhenever the frozen-file list changes.
Source-of-truth note
AGENTS.md is the maintainer source of truth in this repo. Keep this skill aligned with it whenever the regeneration workflow or frozen-file list changes.