developing-genkit-js
Build AI-powered Node.js/TypeScript applications with Genkit flows, tools, and multi-model support.
- Genkit is provider-agnostic; supports Google AI, OpenAI, Anthropic, Ollama, and other LLM providers via plugins
- Define flows with type-safe schemas using Zod, execute generation requests, and compose multi-step AI workflows in TypeScript
- Requires Genkit CLI v1.29.0+; recent major API changes mean you must consult
genkit docs:readand common-errors.md for current patterns, not prior knowledge - Use the CLI to search docs (
genkit docs:search), read guides, and troubleshoot errors; always check Common Errors first when encountering validation, type, or API failures
Genkit JS
Prerequisites
Ensure the genkit CLI is available.
- Run
genkit --versionto verify. Minimum CLI version needed: 1.29.0 - If not found or if an older version (1.x < 1.29.0) is present, install/upgrade it:
npm install -g genkit-cli@^1.29.0.
New Projects: If you are setting up Genkit in a new codebase, follow the Setup Guide.
Hello World
import { z, genkit } from 'genkit';
import { googleAI } from '@genkit-ai/google-genai';
// Initialize Genkit with the Google AI plugin
const ai = genkit({
plugins: [googleAI()],
More from firebase/agent-skills
firebase-basics
>-
50.9Kfirebase-auth-basics
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.
50.4Kfirebase-hosting-basics
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
49.1Kfirebase-app-hosting-basics
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
48.9Kfirebase-data-connect
Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations, writing authorized queries and mutations, configuring real-time data updates, or generating type-safe SDKs. Use when you need a relational database with Firebase, or when the user mentions SQL Connect or Data Connect.
48.6Kdeveloping-genkit-dart
Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications.
47.3K