Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
name: Build and publish to npmjs.com
runs-on: ubuntu-latest
steps:
- name: Setup Node.js 20
- name: Setup Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: Checkout source code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
name: Build and publish to npmjs.com
runs-on: ubuntu-latest
steps:
- name: Setup Node.js 20
- name: Setup Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: Checkout source code
uses: actions/checkout@v4
- name: Install pnpm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
fail-fast: false
matrix:
node-version:
- "20"
- "18"
- "24"
- "22"
os:
- ubuntu-latest
# - macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24

- name: Compare version against base branch
env:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [5.0.0]

- **Breaking**: Require Node.js 22 or later. `engines.node` is now `>=22` (was `>=18`), because Node.js 18 and 20 have reached end of life. There is no runtime change in this release, but installing it on Node.js 18 or 20 fails under package managers that enforce `engines` (Yarn 1, or npm and pnpm with `engine-strict`)

## [4.42.0]

- Add Text-to-Speech: `client.tts.synthesize(request)` returns one text's complete audio (`TextToSpeechResponse`: `audio` plus the response headers as `requestId`, `region`, `model`, `voiceId`, `encoding`, `sampleRate`, `billedCharacters`, `audioDurationMs`, ...), `client.tts.stream(request)` returns it as the API generates it (`TextToSpeechStream`, an async iterable over a web `ReadableStream`), and `client.tts.session(params)` opens a WebSocket `TextToSpeechSession` for voice agents: `connect()`, `generate()` / `flush()` / `audio()`, `speak()`, `cancel()`, `keepAlive()`, `close()`, with `on("audio" | "flushDone" | "wordBoundaries" | "cancelled" | "termination" | "error" | "close", ...)`. Requests take the API's fields (`text`, `voice_id`, `model_id`, `language`, `sample_rate`, `encoding`, `container`, `bit_rate`); failures throw `TextToSpeechError` (`status`, `errorCode`, `param`, `requestId`, `retryable`, `retryAfter`, `errors`, `closeCode`, `body`). New client option `ttsBaseUrl` (default `https://tts.us.assemblyai.com`); `client.tts.createTemporaryToken()` mints a token for browser sessions. Text sent while `connect()` is pending is held and sent the moment the socket opens, so it need not wait for `Begin`
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Gotchas: `stream()` gives up a body that sends no audio for `readTimeout` ms (30
- **Never expose API keys client-side** — use temporary auth tokens for browser streaming
- **Sync timeout is a total deadline** — `transcribe()`, `transcribeLive()` and `openLive()` all default to a 180 s deadline spanning the whole request (upload plus transcription), and the sync API still caps audio at 120 s
- **Dictation timeout is a total 300 s deadline** — `client.dictation` spans the upload, the transcription and the LLM pass in one deadline; the service caps audio at 120 s and accepts WAV or raw 16-bit PCM only
- **Node >= 18 required**
- **Node >= 22 required**
- **Only runtime dependency**: ws (WebSocket library)
- **Multi-runtime support**: Works in Node.js, Deno, Bun, Cloudflare Workers, and browsers

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ pnpm add assemblyai
bun add assemblyai
```

On Node.js, the SDK requires version 22 or later. On Node.js 18 or 20, install version 4 instead: `npm install assemblyai@4`.

Then, import the `assemblyai` module and create an AssemblyAI object with your API key:

```js
Expand Down
4 changes: 2 additions & 2 deletions docs/compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ such as the browser, Deno, Bun, Cloudflare Workers, etc.

## Node.js compatibility

The SDK supports Node.js 18, 20, and 21.
If you do use an older version of Node.js like version 16, you'll need to polyfill `fetch`.
The SDK supports Node.js 22 and later.
If you're still on Node.js 18 or 20, use version 4 of the SDK.

## Browser compatibility

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "assemblyai",
"version": "4.42.0",
"version": "5.0.0",
"description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription and text-to-speech.",
"engines": {
"node": ">=18"
"node": ">=22"
},
"exports": {
".": {
Expand Down Expand Up @@ -133,7 +133,7 @@
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.0",
"@types/jest": "^29.5.13",
"@types/node": "^18.19.53",
"@types/node": "^22.20.5",
"@types/websocket": "^1.0.10",
"@types/ws": "^8.5.12",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand Down
Loading
Loading