Vibeleaderboard
← All Intel
Intel / repo

js-genai v3.0.0

Source
github.com
Author
release-please[bot]
Date

Context

js-genai is Google's official JavaScript and TypeScript library for Gemini. Version 3.0.0 (release notes) shares the main breaking change in the Python library's 3.0.0 release: clients for the Gemini Developer API now call the API's stable v1 version instead of v1beta by default. Clients created with vertexai: true, for Gemini Enterprise on Vertex AI, keep their v1beta1 default. In Node.js, setting GOOGLE_GENAI_API_VERSION=beta restores the old default, and passing apiVersion or httpOptions.apiVersion to GoogleGenAI takes precedence over that variable.

The change matters because the two API versions do not offer the same features. Google's API versions page describes v1 as the stable version and v1beta as the place for features still being developed, and its feature table lists the Live API, , audio output and the Agents and Webhooks APIs under v1beta only. The release notes do not say whether the library still routes those calls to v1beta by itself. The same page also still says the SDKs default to v1beta, which is no longer true of this library from 3.0.0. Code that uses those features should check its calls after upgrading or set the version explicitly.

A second breaking change is the Node.js floor. The package now declares Node.js 22 or later in its engines field, following Node.js 20's end of life in April 2026. The notes say the bump brings no runtime API or bundle changes, and point projects that must stay on Node.js 20 to @google/genai@^2. The third breaking change may need a small edit in TypeScript code: in the Interactions API, a code execution step's result is now typed as either an array of content or a string, so code that treats it as a string has to narrow the type first, although text-only results are still plain strings at runtime. The release also raises the minimum versions of its protobufjs and ws dependencies to patched releases, and disables GenerateVideos on the Gemini Developer API without giving a reason. Live.connect() now rejects its promise if the WebSocket errors or closes before setup completes.

Key takeaways · AI-distilled
  • The v1 default applies only to the Gemini Developer API. Clients created with vertexai: true are unaffected and still default to v1beta1, and an apiVersion passed in code takes precedence over the GOOGLE_GENAI_API_VERSION environment variable.
  • When no version is set in code, GOOGLE_GENAI_API_VERSION=beta restores the earlier beta default on both platforms: v1beta on the Gemini Developer API and v1beta1 on Vertex AI.
  • CodeExecutionResultStep.result is now typed Array<Content> | string to support results. Text-only results are still plain strings at runtime, but TypeScript code that reads it as a string has to narrow the union first.
  • Per the release notes, the Node.js 22 requirement brings no runtime API or bundle changes, and CommonJS and ESM bundles are still published. Projects that must stay on Node.js 20 can pin @google/genai@^2.
  • The release also disables GenerateVideos for the Gemini API, makes Live.connect() reject when the WebSocket errors or closes before setup completes, and raises the protobufjs and ws minimums to patched versions.
Terms in this piece · Glossary
  • prompt caching — Reusing the model's processed form of a repeated prompt prefix so subsequent calls skip re-reading it, cutting cost and latency substantially.
  • multimodal — A model that works with more than text — reading images, audio, or video, and sometimes generating them too.
More from release-please[bot]
Recommended reads
Comments

Checking sign-in…

Loading comments…