Gemini is Google’s generative AI model family used as the primary external AI provider in JavaScript web applications. React renders the interface, Next.js handles backend integrations, and the Vercel AI SDK connects application logic to Gemini. section 1.3
A practical Gemini integration typically combines these moving parts:
- React supplies reusable user-interface components. section 1.3
- Next.js manages backend integrations and data fetching. section 1.3
- The Vercel AI SDK provides provider integration, state hooks, components, and core-logic helpers. section 1.3
- LangChain.js offers an alternative JavaScript framework for conversational chatbots using RAG. section 1.3
Configure a Next.js Gemini chat client
Install Node.js, place the provider secret in .env as GEMINI_API_KEY=<SECRET_KEY>, then run npm run dev -w ch02/chat-client-next. Open the / path to use the Gemini version of the application. section 2.7.1
Figure 1.4 Using key technologies to create generative AI web applications
Use the architecture figure to trace how React, Next.js, the Vercel AI SDK, and external AI providers fit together in a generative AI web application. section 1.3






