🌐
GitHub
github.com › googleapis › js-genai
GitHub - googleapis/js-genai: TypeScript/JavaScript SDK for Gemini and Vertex AI. · GitHub
April 25, 2026 - TypeScript/JavaScript SDK for Gemini and Vertex AI. - googleapis/js-genai
Starred by 1.6K users
Forked by 251 users
Languages   TypeScript 94.3% | JavaScript 5.1% | HTML 0.3% | Shell 0.2% | Starlark 0.1% | CSS 0.0%
🌐
Google
docs.cloud.google.com › gemini enterprise agent platform › google gen ai sdk
Google Gen AI SDK | Gemini Enterprise Agent Platform | Google Cloud Documentation
import ( "context" "fmt" "io" "google.golang.org/genai" ) // generateWithText shows how to generate text using a text prompt. func generateWithText(w io.Writer) error { ctx := context.Background() client, err := genai.NewClient(ctx, &genai.ClientConfig{ HTTPOptions: genai.HTTPOptions{APIVersion: "v1"}, }) if err != nil { return fmt.Errorf("failed to create genai client: %w", err) } resp, err := client.Models.GenerateContent(ctx, "gemini-2.5-flash", genai.Text("How does AI work?"), nil, ) if err != nil { return fmt.Errorf("failed to generate content: %w", err) } respText := resp.Text() fmt.Fprintln(w, respText) // Example response: // That's a great question! Understanding how AI works can feel like ... // ... // **1. The Foundation: Data and Algorithms** // ... return nil } The Google Gen AI SDK for TypeScript and JavaScript is available on npm and GitHub: @google/genai on npm ·
🌐
Apidog
apidog.com › blog › how-to-use-the-google-gen-ai
How to Use the Google Gen AI TypeScript/JavaScript SDK ...
January 30, 2026 - import { GoogleGenAI } from '@google/genai'; const GEMINI_API_KEY = process.env.GEMINI_API_KEY; // Or your actual API key const ai = new GoogleGenAI({ apiKey: GEMINI_API_KEY }); async function run() { // Example: Generate text content const model = ai.models.generateContent({ model: "gemini-pro", // Or a specific Gemini 2.5 model like "gemini-2.5-flash-001" contents: [{ role: "user", parts: [{ text: "Explain the significance of the Google Gen AI SDK."
🌐
Google AI
ai.google.dev › gemini api › gemini api libraries
Gemini API libraries | Google AI for Developers
April 28, 2026 - The Google GenAI SDK is available for the Python, JavaScript/TypeScript, Go and Java languages.
🌐
npm
npmjs.com › package › @google › genai › v › 0.3.1
Google Gen AI SDK for TypeScript and JavaScript
March 11, 2025 - The Google Gen AI JavaScript SDK is an experimental SDK designed for TypeScript and JavaScript developers to build applications powered by Gemini.
      » npm install @google/genai
    
Published   Jun 03, 2026
Version   0.3.1
🌐
Medium
pierre-schwartz.medium.com › google-gen-ai-and-typescript-8047d23158ff
Google Gemini and TypeScript. Explore the Gen AI tools in a typical… | by Pierre Schwartz | Medium
October 18, 2025 - The Google Gen AI SDK for TypeScript has just been released in April 2025. Let’s use it ! The official doc will be your friend : https://googleapis.github.io/js-genai/main/index.html · In this short article I will demonstrate the easyness ...
🌐
npm
npmjs.com › package › @google › genai
google/genai
1 week ago - Documentation: https://googleapis.github.io/js-genai/ The Google Gen AI JavaScript SDK is designed for TypeScript and JavaScript developers to build applications powered by Gemini.
      » npm install @google/genai
    
Published   Jun 24, 2026
Version   2.10.0
🌐
GitHub
github.com › mohitejaikumar › generative-ai-js
GitHub - mohitejaikumar/generative-ai-js: The official Node.js / Typescript library for the Google Gemini API · GitHub
The official Node.js / Typescript library for the Google Gemini API - mohitejaikumar/generative-ai-js
Author   mohitejaikumar
🌐
Hugging Face
huggingface.co › blog › lynn-mikami › google-gen-ai-sdk
How to Use the Google Gen AI TypeScript/JavaScript SDK: A Comprehensive Guide
May 27, 2025 - import {GoogleGenAI} from '@google/genai'; // Ensure your API key is set as an environment variable const GEMINI_API_KEY = process.env.GEMINI_API_KEY; const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY}); async function main() { try { const response = await ai.models.generateContent({ model: 'gemini-2.0-flash-001', // Or your desired model contents: 'Why is the sky blue?', }); // Assuming response.text is the correct way to access the text based on SDK structure // The actual response structure might be response.candidates[0].content.parts[0].text // For simplicity, we'll refer to a conceptual 'response.text' as per the README's quickstart.
Find elsewhere
🌐
DEV Community
dev.to › asross311 › taming-the-interactions-api-in-the-googlegenai-sdk-561b
Taming the Interactions API in the @google/genai SDK - DEV Community
December 25, 2025 - Google released beta support for a new Interactions API on 2025-12-11, described as "a unified interface for interacting with Gemini models and agents". The latest @google/genai SDK (v1.34.0 as of writing) surfaces this beta API, unlocking preview support for Deep Research tasks with background polling. There's just one problem: you can't use it safely or sanely in TypeScript.
🌐
GitHub
github.com › googleapis › js-genai › blob › main › codegen_instructions.md
js-genai/codegen_instructions.md at main · googleapis/js-genai
TypeScript/JavaScript SDK for Gemini and Vertex AI. - js-genai/codegen_instructions.md at main · googleapis/js-genai
Author   googleapis
🌐
npm
npmjs.com › package › @zdooon › google-genai
@zdooon/google-genai - npm
November 27, 2025 - The Google Gen AI JavaScript SDK is designed for TypeScript and JavaScript developers to build applications powered by Gemini. The SDK supports both the Gemini Developer API and Vertex AI.
      » npm install @zdooon/google-genai
    
Published   Nov 27, 2025
Version   1.30.0
🌐
GitHub
github.com › smartground › google-genai-sdk-js
GitHub - smartground/google-genai-sdk-js: TypeScript/JavaScript SDK for Gemini and Vertex. [EXPERIMENTAL]
import {GoogleGenAI} from '@google/genai'; const GEMINI_API_KEY = process.env.GEMINI_API_KEY; const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY}); async function main() { const response = await ai.models.generateContentStream({ model: 'gemini-2.0-flash-001', contents: 'Write a 100-word poem.', }); for await (const chunk of response) { console.log(chunk.text); } } main();
Author   smartground
🌐
Learnbydo
learnbydo.ing › blog › geminisdk-node-typescript
Building with Gemini: Your First Node.js AI App with Native TypeScript
April 2, 2026 - Initialize a zero-config TypeScript project using Node’s native runner. Securely integrate the Gemini API using environment variables. Generate AI responses with the @google/genai library.
🌐
Medium
medium.com › google-cloud › how-to-build-genai-apps-for-resilience-with-typescript-06908aca62c2
How to build GenAI apps for resilience with TypeScript | by Karl Weinmeister | Google Cloud - Community | Medium
March 2, 2026 - Here’s how you configure the SDK natively in TypeScript. First, initialize the client once outside the request handler so you can reuse connection pools: import { GoogleGenAI } from '@google/genai'; export const aiClient = new GoogleGenAI({ vertexai: true, project: process.env.GOOGLE_CLOUD_PROJECT_ID, location: 'global', httpOptions: { // Rely on the SDK's built-in retry logic retryOptions: { attempts: 5, }, timeout: 120 * 1000, }, });
🌐
LangChain Forum
forum.langchain.com › oss product help
Upgrade Google Generative AI SDK integration from @google/generative-ai to @google/genai - LangChain - LangChain Forum
November 5, 2025 - (Yarn) The recommended library for JavaScript/TypeScript is @google/genai, provided at https://github.com/googleapis/js-genai. (GitHub) Google Cloud’s deprecation guide states that the ...
🌐
Google
developers.google.com › solutions › getting started with the gemini api and web apps
Getting started with the Gemini API and Web apps | Solutions for Developers | Google for Developers
The Google Gen AI SDK for JavaScript and TypeScript enables you to build your generative AI integration with the Gemini Developer API.
🌐
GitHub
github.com › AndyC2513 › generative-ai-js
GitHub - andyc2513/generative-ai-js: The official Node.js / Typescript library for the Google Gemini API
The official Node.js / Typescript library for the Google Gemini API - andyc2513/generative-ai-js
Author   andyc2513
🌐
Google Cloud
cloud.google.com › vertex ai › generative ai on vertex ai › typescript migration
Typescript migration | Generative AI on Vertex AI | Google Cloud Documentation
Translate JavaScript to TypeScript · You can query a model directly and test the results returned when using different parameter values with the Cloud console, or by calling the Vertex AI API directly. For an example of using the Vertex AI API, see Quickstart using the Vertex AI API.