🌐
npm
npmjs.com › package › @google › generative-ai
google/generative-ai
April 29, 2025 - Google AI JavaScript SDK. Latest version: 0.24.1, last published: a year ago. Start using @google/generative-ai in your project by running `npm i @google/generative-ai`. There are 1945 other projects in the npm registry using @google/generative-ai.
      » npm install @google/generative-ai
    
Published   Apr 29, 2025
Version   0.24.1
🌐
npm
npmjs.com › package › @google › genai
google/genai
1 week ago - Call generateContent with function calling enabled · Use the returned FunctionCall parameters to call your actual function · Send the result back to the model (with history, easier in ai.chat) as a FunctionResponse · import {GoogleGenAI, FunctionCallingConfigMode, FunctionDeclaration, Type} from '@google/genai'; const GEMINI_API_KEY = process.env.GEMINI_API_KEY; async function main() { const controlLightDeclaration: FunctionDeclaration = { name: 'controlLight', parametersJsonSchema: { type: 'object', properties:{ brightness: { type:'number', }, colorTemperature: { type:'string', }, }, requi
      » npm install @google/genai
    
Published   Jun 24, 2026
Version   2.10.0
🌐
npm
npmjs.com › package › @google-ai › generativelanguage
google-ai/generativelanguage
January 29, 2026 - Generative Language API client for Node.js. Latest version: 3.7.1, last published: a month ago. Start using @google-ai/generativelanguage in your project by running `npm i @google-ai/generativelanguage`. There are 36 other projects in the npm registry using @google-ai/generativelanguage.
      » npm install @google-ai/generativelanguage
    
Published   May 01, 2026
Version   3.7.1
🌐
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
🌐
Google
codelabs.developers.google.com › codelabs › deploy-from-github › gen-ai-nodejs
Automatically Deploy Generative AI Node.js Web Application from Version Control to Cloud Run | Google Codelabs
console.log(JSON.stringify({ severity: 'DEBUG', message: 'Content is generated', prompt: prompt, response: resp.response, })); This code writes to stdout information about generated content using structured logging format. A logging agent in Cloud Run captures output printed to stdout and writes this format to Cloud Logging. Reopen Cloud Shell and type the following command to ensure that you are in the correct directory: ... After the new version is deployed you can observe the debug information about calls to Vertex AI.
🌐
npm
npmjs.com › package › @google › generative-ai › v › 0.8.0
@google/generative-ai - npm
April 22, 2024 - Assign your API key to an environment variable: export API_KEY=MY_API_KEY. Serve your web app by running: npm run http-server. Open the displayed URL in a browser. For Node.js (or web projects using NPM), run npm install @google/generative-ai.
      » npm install @google/generative-ai
    
Published   Apr 29, 2025
Version   0.8.0
🌐
Rishav's Blog
rishavd3v.hashnode.dev › google-gemini-with-nodejs
Google Gemini Generative AI Integration in Node JS
August 31, 2025 - Beginner's guide to integrating Google Gemini generative AI with a Node.js and express application. Build AI powered website using node js.
🌐
Medium
medium.com › @pvnsripati › i-built-an-ai-that-interviews-you-with-node-js-and-google-gemini-api-2ffb9d4bdffc
I Built an AI That Interviews You using Node.js and Google Gemini API | by Praveen Sripati | Medium
June 20, 2025 - The key to solving this was adjusting the AI’s temperature—its "creativity" dial. In my server.js file, I configured the Gemini model with a high temperature to ensure it would generate unique responses for every request. // Import the Google AI client const { GoogleGenerativeAI } = require('@google/generative-ai'); const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); // Define a generation config with a high temperature for unique responses const generationConfig = { temperature: 0.9, }; // Initialize the model WITH the new generation configuration const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash", generationConfig: generationConfig, // Pass our new config here });
Find elsewhere
🌐
Fek
fek.io › blog › using-googles-gemini-generative-ai-with-node-js
Using Google's Gemini Generative AI with Node.js - FEK.IO
import { GoogleGenerativeAI, HarmCategory, HarmBlockThreshold } from "@google/generative-ai"; const MODEL_NAME = "gemini-pro"; const API_KEY = process.env.GEMINI_API_KEY; async function run() { const genAI = new GoogleGenerativeAI(API_KEY); const model = genAI.getGenerativeModel({ model: MODEL_NAME }); const generationConfig = { temperature: 0.9, topK: 1, topP: 1, maxOutputTokens: 2048, }; const safetySettings = [ { category: HarmCategory.HARM_CATEGORY_HARASSMENT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, }, { category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold: HarmBlockTh
🌐
DEV Community
dev.to › hriztam › integrating-generative-ai-into-a-nodejs-application-25ag
Integrating Generative AI into a Node.js Application - DEV Community
February 16, 2024 - In this article, we've demonstrated how to integrate Google Gemini into a Node.js application, leveraging the Google Generative AI SDK. By following these steps, you can harness the power of Gemini to enhance the capabilities of your Node.js projects.
🌐
Medium
medium.com › @rajreetesh7 › integrating-google-gemini-to-node-js-application-e45328613130
Integrating Google Gemini to Node.js Application | by Reetesh Kumar | Medium
January 22, 2024 - You can create a new API by visiting the Google AI Platform website. To create a new API key, click on the Get API Key button. once you get the API key, save it in a .env file in the root of your project. ... Now that we have the API key, let’s set up the Google Gemini SDK. Create a new file called index.js in the root of your project and add the following code: import { GoogleGenerativeAI } from "@google/generative-ai"; import dotenv from "dotenv"; dotenv.config(); const gemini_api_key = process.env.API_KEY; const googleAI = new GoogleGenerativeAI(gemini_api_key); const geminiConfig = { tem
🌐
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
Explore Google AI Studio and the capabilities of the Gemini generative AI model. Learn how to design and test the different types of prompts (freeform, structured, and chat), get an API key, and build a simple NodeJS application.
🌐
GitHub
github.com › google › generative-ai-js › issues › 77
nodeJS @google/generative-ai is pointing to v1/models don't see any option to change to v1beta/models · Issue #77 · google-gemini/deprecated-generative-ai-js
March 28, 2024 - // npm install @google/generative-ai const { GoogleGenerativeAI, HarmCategory, HarmBlockThreshold, } = require("@google/generative-ai"); const MODEL_NAME = "tunedModels/<modelname>"; const API_KEY = "YOUR_API_KEY"; async function run() { const genAI = new GoogleGenerativeAI(API_KEY); const model = genAI.getGenerativeModel({ model: MODEL_NAME }); const generationConfig = { temperature: 0.9, topK: 1, topP: 1, maxOutputTokens: 8192, }; const safetySettings = [ ]; const parts = [ {text: "input: "}, {text: "output: "}, ]; const result = await model.generateContent({ contents: [{ role: "user", parts }], generationConfig, safetySettings, }); const response = result.response; console.log(response.text()); } run();``` ### Actual vs expected behavior: Current behavior the URL is pointing to ```v1/tunedModels``` but for tuned models it should point to ```v1beta/tunedModels``` .
Author   google-gemini
🌐
Apidog
apidog.com › blog › how-to-use-the-google-gen-ai
How to Use the Google Gen AI TypeScript/JavaScript SDK ...
January 30, 2026 - Apidog delivers all your demands, and replaces Postman at a much more affordable price! ... The Google Gen AI JavaScript SDK is meticulously designed to enable developers to integrate Google's advanced generative AI capabilities into their web and Node.js applications.
🌐
Medium
medium.com › @sachbisht › quick-generative-ai-integration-in-node-js-5ca816f63093
Quick Generative AI integration using Node.js | by Sachin Bisht | Medium
July 22, 2024 - Generative AI describes algorithms such as Gemini, ChatGPT, Midjourney, etc, that can be used to create new content, that includes text, image, video, etc. ... Node & NPM installed on your PC. A Google account to generate API key for Gemini.
🌐
Google AI
discuss.ai.google.dev › gemini api
Gounding in @google/generative-ai for node.js - Gemini API - Google AI Developers Forum
December 14, 2024 - I tried to run the example code from this URL Grounding with Google Search | Gemini API | Google AI for Developers import { DynamicRetrievalMode, GoogleGenerativeAI, } from "@google/generative-ai"; const genAI = new GoogleGenerativeAI(process.env.API_KEY); const model = genAI.getGenerativeModel( { model: "models/gemini-1.5-pro-002", tools: [ { googleSearchRetrieval: { dynamicRetrievalConfig: { mode: DynamicRetrievalMode.MODE_DYNAMIC, ...
🌐
Rootstrap
rootstrap.com › blog › how-to-use-google-gemini-with-node-js-and-typescript
How to use Google Gemini with Node.js and TypeScript
February 1, 2024 - To use Gemini with Node.js (or any other language) we need to use Gemini API. For that purpose, we can use the google generative-ai package, which provides a simple way to interact with the Gemini API and has TypeScript support.
🌐
Google AI
ai.google.dev › gemini api › getting started with gemini api
Getting started with Gemini API | Google AI for Developers
2 weeks ago - Set store=false and manage conversation history on the client side. You must preserve and resend all model-generated steps (including thought and function_call steps) exactly as received.