firebase-ai-logic-basics

Integrates Firebase AI Logic Gemini API into web, iOS, Android, and Flutter applications.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/DingJun1028/esggo-kv --skill firebase-ai-logic-basics-dingjun1028
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-ai-logic-basics
Source: https://github.com/DingJun1028/esggo-kv/tree/main/.agents/skills/firebase-ai-logic-basics
Command: npx skills add https://github.com/DingJun1028/esggo-kv --skill firebase-ai-logic-basics-dingjun1028

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires firebase, firebase-tools, firebase_ai, firebase_core, firebase_auth, and includes references (resource) components.

What problem does it solve? Adding generative AI to client apps usually requires managing a backend proxy for API keys and model calls. This Skill guides you through integrating Firebase AI Logic so your app can call Gemini models directly from client-side SDKs with proper provisioning, security, and platform-specific setup. ## Core Features & Use Cases - Setup & Provisioning: Walks through Firebase CLI installation, project selection, and the mandatory firebase-tools init ailogic step that enables the Gemini Developer API. - Core Generation Capabilities: Covers text generation, multimodal input (images, audio, video, PDF), multi-turn chat sessions, streaming responses, image generation, and structured JSON output. - Security & Production Readiness: Enforces App Check setup to protect API quota and recommends Remote Config for updating model names without redeploying. - Use Case: You are building a Flutter app that summarizes user-uploaded photos. Use this Skill to provision AI Logic, initialize the firebase_ai package with gemini-flash-latest, and implement multimodal inference with App Check enabled. ## Quick Start Ask the assistant to set up Firebase AI Logic in your web app and generate text with the Gemini Developer API.

Frequently Asked Questions about firebase-ai-logic-basics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Gemini AI to my web app with Firebase?▼

Install the Firebase Web SDK, run npx firebase-tools init ailogic to enable the Gemini Developer API, then initialize with getAI and getGenerativeModel from firebase/ai. You can then call generateContent for text or multimodal prompts directly from the client.

What is the difference between Gemini Developer API and Vertex AI Gemini API?▼

The Gemini Developer API offers a free tier for prototyping and pay-as-you-go pricing, making it the default choice. The Vertex AI Gemini API targets enterprise-scale production workloads and requires a Blaze billing plan.

Does Firebase AI Logic work with Flutter and iOS?▼

Yes, it supports Flutter via the firebase_ai package, iOS via the FirebaseAILogic Swift SDK, Android via Kotlin, and web via JavaScript. Each platform requires running firebase-tools init ailogic first to provision the backend service.

Why am I getting PERMISSION_DENIED errors with Firebase AI Logic?▼

PERMISSION_DENIED occurs when the AI service was never provisioned in your Firebase project. Running flutterfire configure only handles client configuration; you must run npx firebase-tools init ailogic to enable the Gemini API backend.

How do I handle files larger than 20MB with Gemini multimodal input?▼

Files over 20 megabytes cause HTTP 413 errors when sent as inline base64 data. Store them in Cloud Storage for Firebase and pass the file URLs to the Gemini Developer API instead.

Is App Check required for Firebase AI Logic?▼

Yes, App Check is a critical requirement before production use. It prevents unauthorized clients from consuming your API quota and accessing backend resources, and can be configured with reCAPTCHA Enterprise for web apps.