firebase-ai-logic-basics

Integrates Firebase AI Logic Gemini API into web and mobile applications.

2|Updated Mar 7, 2025
One-click install
npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill firebase-ai-logic-basics-abdelrhmanuzaki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-ai-logic-basics
Source: https://github.com/AbdelrhmanUZaki/KnowledgeNuggets/tree/main/2-setup/shared/gemini/config/plugins/firebase/skills/firebase_ai_logic_basics
Command: npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill firebase-ai-logic-basics-abdelrhmanuzaki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires firebase, firebase-tools, 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 developers through integrating Firebase AI Logic so apps can call Gemini models directly from client-side SDKs with proper setup and security. ## Core Features & Use Cases - Setup & Initialization: Install the Firebase SDK, select a project, and provision AI Logic with the firebase-tools init command across Web, iOS, Android, Flutter, and Unity. - Multimodal Inference: Generate text, analyze images, audio, video, and PDFs, run multi-turn chat sessions, and stream responses for real-time display. - Structured Output & Security: Enforce JSON schemas on responses, protect API quota with App Check, and manage model versions remotely via Remote Config. - Use Case: A developer building a web app wants to add an image-captioning feature. This Skill walks them through installing the SDK, initializing AI Logic, sending an image with a prompt to Gemini, and securing the integration with App Check. ## Quick Start Ask the assistant to set up Firebase AI Logic in your web app and generate text from a prompt using 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 SDK with npm, then run npx firebase-tools init ailogic to provision the Gemini Developer API. Initialize the AI Logic SDK in your app and call generateContent with a prompt to get responses from Gemini models.

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 the Blaze billing plan.

Does Firebase AI Logic support image and PDF analysis?▼

Yes, Gemini models can analyze images, audio, video, and PDFs passed as inline data with their MIME type. Files larger than 20 megabytes should be stored in Cloud Storage for Firebase and referenced by URL to avoid HTTP 413 errors.

Why do I get PERMISSION_DENIED errors with Firebase AI Logic?▼

PERMISSION_DENIED occurs when the AI service was never provisioned for the project. Run npx firebase-tools init ailogic to enable it, since tools like flutterfire configure only handle client configuration and do not activate the backend service.

How do I secure Firebase AI Logic API keys in a client app?▼

Set up Firebase App Check, for example with reCAPTCHA Enterprise on web, to prevent unauthorized clients from consuming your API quota. You can also use Remote Config to manage model names without hardcoding them in client code.