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.41.4]

- Fix `RealtimeTranscriber.connect()` promise hanging indefinitely when a socket error or unexpected close occurs before `SessionBegins`. The promise now rejects, and the socket reference is discarded so that connections can be safely retried.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ strings, when present).
- **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
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "assemblyai",
"version": "4.41.4",
"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.",
"engines": {
"node": ">=18"
"node": ">=22"
},
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const encoder = new TextEncoder();
/**
* Generates a multipart boundary. Random alphanumerics behind a fixed prefix,
* as `FormData` implementations do; `Math.random` rather than Web Crypto
* because `globalThis.crypto` is flagged on Node 18, which is still supported.
* because `globalThis.crypto` was flagged on Node 18.
* @returns The boundary token, without the leading dashes.
*/
export function multipartBoundary(): string {
Expand Down
8 changes: 5 additions & 3 deletions tests/unit/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe("utils", () => {
const userAgent = buildUserAgent({});
expect(userAgent).toContain("AssemblyAI/1.0 (");
expect(userAgent).toContain("sdk=JavaScript/__SDK_VERSION__");
expect(userAgent).toContain("runtime_env=Node/");
// Node 21+ sets `navigator.userAgent` to "Node.js/<major>", which prefixes
// the UA in place of a `runtime_env` entry.
expect(userAgent).toMatch(/^Node\.js\/\d+ /);
});

it("should build a user-agent with extras", () => {
Expand All @@ -67,7 +69,7 @@ describe("utils", () => {
});
expect(userAgent).toContain("AssemblyAI/1.0 (");
expect(userAgent).toContain("sdk=JavaScript/__SDK_VERSION__");
expect(userAgent).toContain("runtime_env=Node/");
expect(userAgent).toMatch(/^Node\.js\/\d+ /);
expect(userAgent).toContain("integration=Zapier/1.0.0");
});

Expand All @@ -89,7 +91,7 @@ describe("utils", () => {
});
expect(userAgent).toContain("AssemblyAI/1.0 (");
expect(userAgent).toContain("sdk=TS/1.0");
expect(userAgent).toContain("runtime_env=Node/");
expect(userAgent).toMatch(/^Node\.js\/\d+ /);
expect(userAgent).not.toContain("os=");
});

Expand Down
Loading